Skip to content

Commit

Permalink
Merge pull request #472 from steveb/novarlogironic
Browse files Browse the repository at this point in the history
Clean up usage of /var/log/ironic
  • Loading branch information
openshift-merge-bot[bot] authored Sep 17, 2024
2 parents 4c5724b + 0a26cab commit 13e2efa
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 42 deletions.
2 changes: 1 addition & 1 deletion pkg/ironic/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func GetDBSyncVolumeMounts() []corev1.VolumeMount {

volumeMounts := []corev1.VolumeMount{
{
Name: "config-data-merged",
Name: "config-data",
MountPath: "/var/lib/kolla/config_files/config.json",
SubPath: "db-sync-config.json",
ReadOnly: true,
Expand Down
3 changes: 2 additions & 1 deletion pkg/ironicapi/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ func GetInitVolumeMounts() []corev1.VolumeMount {
func GetVolumeMounts() []corev1.VolumeMount {
volumeMounts := []corev1.VolumeMount{
{
Name: "config-data-merged",
Name: "config-data",
MountPath: "/var/lib/kolla/config_files/config.json",
SubPath: "ironic-api-config.json",
ReadOnly: true,
},
GetLogVolumeMount(),
}

return append(ironic.GetVolumeMounts(), volumeMounts...)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ironicconductor/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func GetInitVolumeMounts() []corev1.VolumeMount {
func GetVolumeMounts(serviceName string) []corev1.VolumeMount {
volumeMounts := []corev1.VolumeMount{
{
Name: "config-data-merged",
Name: "config-data",
MountPath: "/var/lib/kolla/config_files/config.json",
SubPath: serviceName + "-config.json",
ReadOnly: true,
Expand Down
2 changes: 1 addition & 1 deletion pkg/ironicneutronagent/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func GetVolumeMounts() []corev1.VolumeMount {
ReadOnly: false,
},
{
Name: "config-data-merged",
Name: "config-data",
MountPath: "/var/lib/kolla/config_files/config.json",
SubPath: "ironic-neutron-agent-config.json",
ReadOnly: true,
Expand Down
7 changes: 0 additions & 7 deletions templates/ironic/config/db-sync-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,5 @@
"owner": "ironic",
"perm": "0644"
}
],
"permissions": [
{
"path": "/var/log/ironic",
"owner": "ironic:ironic",
"recurse": true
}
]
}
9 changes: 2 additions & 7 deletions templates/ironicapi/config/ironic-api-httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Include conf.d/*.conf
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy

ErrorLog /dev/stdout
ServerSignature Off
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog /dev/stdout combined env=!forwarded
CustomLog /dev/stdout proxy env=forwarded
Expand All @@ -37,13 +39,6 @@ CustomLog /dev/stdout proxy env=forwarded
Require all granted
</Directory>

## Logging
ErrorLog /dev/stdout
ServerSignature Off
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog /dev/stdout combined env=!forwarded
CustomLog /dev/stdout proxy env=forwarded

{{- if $vhost.TLS }}
SetEnvIf X-Forwarded-Proto https HTTPS=1

Expand Down
5 changes: 0 additions & 5 deletions templates/ironicconductor/config/dnsmasq-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
}
],
"permissions": [
{
"path": "/var/log/ironic",
"owner": "ironic:ironic",
"recurse": true
},
{
"path": "/var/lib/ironic",
"owner": "ironic:ironic",
Expand Down
5 changes: 0 additions & 5 deletions templates/ironicconductor/config/httpboot-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
}
],
"permissions": [
{
"path": "/var/log/ironic",
"owner": "ironic:ironic",
"recurse": true
},
{
"path": "/var/lib/ironic",
"owner": "ironic:ironic",
Expand Down
6 changes: 2 additions & 4 deletions templates/ironicconductor/config/httpboot-httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Include conf.d/*.conf
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy

ErrorLog /dev/stdout
ServerSignature Off
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog /dev/stdout combined env=!forwarded
CustomLog /dev/stdout proxy env=forwarded
Expand All @@ -36,8 +38,4 @@ CustomLog /dev/stdout proxy env=forwarded
Require all granted
</Directory>

## Logging
ErrorLog "/var/log/httpd/httpboot_vhost_error.log"
ServerSignature Off
CustomLog "/var/log/httpd/httpboot_vhost_access.log" combined
</VirtualHost>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],
"permissions": [
{
"path": "/var/log/ironic",
"path": "/var/lib/ironic",
"owner": "ironic:ironic",
"recurse": true
}
Expand Down
6 changes: 2 additions & 4 deletions templates/ironicinspector/config/httpboot-httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Include conf.d/*.conf
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy

ErrorLog /dev/stdout
ServerSignature Off
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog /dev/stdout combined env=!forwarded
CustomLog /dev/stdout proxy env=forwarded
Expand All @@ -36,8 +38,4 @@ CustomLog /dev/stdout proxy env=forwarded
Require all granted
</Directory>

## Logging
ErrorLog "/var/log/httpd/httpboot_vhost_error.log"
ServerSignature Off
CustomLog "/var/log/httpd/httpboot_vhost_access.log" combined
</VirtualHost>
7 changes: 2 additions & 5 deletions templates/ironicinspector/config/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Include conf.d/*.conf
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy

ErrorLog /dev/stdout
ServerSignature Off
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog /dev/stdout combined env=!forwarded
CustomLog /dev/stdout proxy env=forwarded
Expand All @@ -27,11 +29,6 @@ CustomLog /dev/stdout proxy env=forwarded
<VirtualHost *:5050>
ServerName {{ $vhost.ServerName }}

## Logging
ErrorLog /dev/stdout
ServerSignature Off
CustomLog /dev/stdout combined

## Request header rules
## as per http://httpd.apache.org/docs/2.2/mod/mod_headers.html#requestheader
RequestHeader set X-Forwarded-Proto "https"
Expand Down

0 comments on commit 13e2efa

Please sign in to comment.