From 2c6bc0bd1a88c13388866c2659743e8448a6677f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Sat, 25 Sep 2021 20:05:02 +0000 Subject: [PATCH] Do not create haproxy and swift log dirs needlessly Closes-Bug: #1945070 Change-Id: I1b2a82b57cb9884b6c3c3ad07f6449ae29042a3d --- ansible/roles/common/templates/conf/output/00-local.conf.j2 | 4 ++++ ansible/roles/common/templates/fluentd.json.j2 | 4 ++++ releasenotes/notes/bug-1945070-965635387a8581f9.yaml | 6 ++++++ 3 files changed, 14 insertions(+) create mode 100644 releasenotes/notes/bug-1945070-965635387a8581f9.yaml diff --git a/ansible/roles/common/templates/conf/output/00-local.conf.j2 b/ansible/roles/common/templates/conf/output/00-local.conf.j2 index adfa7ff4df..ba46b519bd 100644 --- a/ansible/roles/common/templates/conf/output/00-local.conf.j2 +++ b/ansible/roles/common/templates/conf/output/00-local.conf.j2 @@ -1,3 +1,4 @@ +{% if enable_swift | bool and (inventory_hostname in groups['swift-proxy-server'] or inventory_hostname in groups['swift-account-server'] or inventory_hostname in groups['swift-container-server'] or inventory_hostname in groups['swift-object-server']) %} @type copy @@ -58,7 +59,9 @@ {% endif %} +{% endif %} +{% if enable_haproxy | bool and inventory_hostname in groups['loadbalancer'] %} @type copy @@ -121,6 +124,7 @@ {% endif %} +{% endif %} {% if glance_enable_tls_backend | bool %} diff --git a/ansible/roles/common/templates/fluentd.json.j2 b/ansible/roles/common/templates/fluentd.json.j2 index 8ca82bf130..0df04b1aad 100644 --- a/ansible/roles/common/templates/fluentd.json.j2 +++ b/ansible/roles/common/templates/fluentd.json.j2 @@ -29,11 +29,13 @@ "owner": "{{ fluentd_user }}:{{ fluentd_user }}", "recurse": true }, +{% if enable_haproxy | bool and inventory_hostname in groups['loadbalancer'] %} { "path": "/var/log/kolla/haproxy", "owner": "{{ fluentd_user }}:{{ fluentd_user }}", "recurse": true }, +{% endif %} {% if glance_enable_tls_backend | bool %} { "path": "/var/log/kolla/glance-tls-proxy", @@ -48,11 +50,13 @@ "recurse": true }, {% endif %} +{% if enable_swift | bool and (inventory_hostname in groups['swift-proxy-server'] or inventory_hostname in groups['swift-account-server'] or inventory_hostname in groups['swift-container-server'] or inventory_hostname in groups['swift-object-server']) %} { "path": "/var/log/kolla/swift", "owner": "{{ fluentd_user }}:{{ fluentd_user }}", "recurse": true }, +{% endif %} { "path": "/var/lib/fluentd/data", "owner": "{{ fluentd_user }}:{{ fluentd_user }}", diff --git a/releasenotes/notes/bug-1945070-965635387a8581f9.yaml b/releasenotes/notes/bug-1945070-965635387a8581f9.yaml new file mode 100644 index 0000000000..1c1728b416 --- /dev/null +++ b/releasenotes/notes/bug-1945070-965635387a8581f9.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + No longer creates directories for haproxy and swift logs where they + are not needed. + `LP#1945070 `__