From e7870e9df9e416b1b342ad6264bb66378fe62b3f Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Thu, 6 Feb 2020 17:10:06 +0000 Subject: [PATCH] Delete stale fluent config on restart We already only include .conf files in fluent.conf: (fluentd)[fluentd@cpu-e-1041 /etc/fluentd]$ cat fluent.conf @include input/*.conf @include filter/*.conf @include format/*.conf @include output/*.conf so this change should not cause ill effect. This works because of the merge option in config files: merge: merges the source directory into the target directory instead of replacing it. Boolean, defaults to false. see https://docs.openstack.org/kolla/latest/admin/kolla_api.html#kolla-api-external-config Change-Id: I28f63ec81f1ea5bc4a213d053bfb2c04388d5925 Closes-Bug: #1862211 --- ansible/roles/common/templates/fluentd.json.j2 | 16 ++++++++-------- .../notes/bug-1862211-1c44c4a16963baad.yaml | 7 +++++++ 2 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 releasenotes/notes/bug-1862211-1c44c4a16963baad.yaml diff --git a/ansible/roles/common/templates/fluentd.json.j2 b/ansible/roles/common/templates/fluentd.json.j2 index 9cef1f8a68..fe7cdd4c04 100644 --- a/ansible/roles/common/templates/fluentd.json.j2 +++ b/ansible/roles/common/templates/fluentd.json.j2 @@ -25,32 +25,32 @@ {# Copy all configuration files in input/ directory to include #} {# custom input configs. #} { - "source": "{{ container_config_directory }}/input/*.conf", - "dest": "{{ fluentd_dir }}/input/", + "source": "{{ container_config_directory }}/input", + "dest": "{{ fluentd_dir }}/input", "owner": "{{ fluentd_user }}", "perm": "0600" }, {# Copy all configuration files in filter/ directory to include #} {# custom filter configs. #} { - "source": "{{ container_config_directory }}/filter/*.conf", - "dest": "{{ fluentd_dir }}/filter/", + "source": "{{ container_config_directory }}/filter", + "dest": "{{ fluentd_dir }}/filter", "owner": "{{ fluentd_user }}", "perm": "0600" }, {# Copy all configuration files in format/ directory to include #} {# custom format configs. #} { - "source": "{{ container_config_directory }}/format/*.conf", - "dest": "{{ fluentd_dir }}/format/", + "source": "{{ container_config_directory }}/format", + "dest": "{{ fluentd_dir }}/format", "owner": "{{ fluentd_user }}", "perm": "0600" }, {# Copy all configuration files in output/ directory to include #} {# custom output configs. #} { - "source": "{{ container_config_directory }}/output/*.conf", - "dest": "{{ fluentd_dir }}/output/", + "source": "{{ container_config_directory }}/output", + "dest": "{{ fluentd_dir }}/output", "owner": "{{ fluentd_user }}", "perm": "0600" } diff --git a/releasenotes/notes/bug-1862211-1c44c4a16963baad.yaml b/releasenotes/notes/bug-1862211-1c44c4a16963baad.yaml new file mode 100644 index 0000000000..ca541e55ab --- /dev/null +++ b/releasenotes/notes/bug-1862211-1c44c4a16963baad.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fixes an issue where old fluentd configuration files would persist + in the container across restarts despite being removed from the + ``node_custom_config`` directory. + `LP#1862211 `__