From e00bb43baef131be07bfecef494ccb5e54c81566 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Mon, 22 Jul 2024 19:15:21 +0200 Subject: [PATCH] common: support custom cron-logrotate-global.conf This extends the functionality of being able to add per-node custom configuration to the cron-logrotate config, similar to what we already have in place for other configuration files. Change-Id: Ia94cc960abff2850e64d60ac997e8a2e249e4ac4 --- ansible/roles/common/tasks/config.yml | 6 +++++- .../custom-cron-logrotate-global-5cb26fda7d1ba85b.yaml | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/custom-cron-logrotate-global-5cb26fda7d1ba85b.yaml diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index 796f5a50ac..f4a116c4a2 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -204,12 +204,16 @@ - { name: "watcher", enabled: "{{ enable_watcher | bool }}" } - { name: "zun", enabled: "{{ enable_zun | bool }}" } template: - src: "cron-logrotate-global.conf.j2" + src: "{{ item }}" dest: "{{ node_config_directory }}/cron/logrotate.conf" mode: "0660" become: true when: - common_services.cron | service_enabled_and_mapped_to_host + with_first_found: + - "{{ node_custom_config }}/cron/{{ inventory_hostname }}/cron-logrotate-global.conf" + - "{{ node_custom_config }}/cron/cron-logrotate-global.conf" + - "cron-logrotate-global.conf.j2" - name: Ensure RabbitMQ Erlang cookie exists become: true diff --git a/releasenotes/notes/custom-cron-logrotate-global-5cb26fda7d1ba85b.yaml b/releasenotes/notes/custom-cron-logrotate-global-5cb26fda7d1ba85b.yaml new file mode 100644 index 0000000000..c763473221 --- /dev/null +++ b/releasenotes/notes/custom-cron-logrotate-global-5cb26fda7d1ba85b.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + It is now possible to use a custom ``cron-logrotate-global.conf`` file.