From 7ef23cd500c1197f651e5c3483e197245dbfec33 Mon Sep 17 00:00:00 2001 From: Brendan Shephard Date: Thu, 16 Jan 2025 14:02:46 +1000 Subject: [PATCH] Render kolla_config files for bootc Signed-off-by: Brendan Shephard --- .../tasks/logrotate_crond.yml | 20 +++++++++++++------ roles/edpm_logrotate_crond/tasks/run.yml | 20 +++++++++++++------ roles/edpm_ovn/tasks/run.yml | 2 +- roles/edpm_podman/tasks/install.yml | 10 ++++++++++ 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/roles/edpm_logrotate_crond/tasks/logrotate_crond.yml b/roles/edpm_logrotate_crond/tasks/logrotate_crond.yml index 093de201b..f97390bcf 100644 --- a/roles/edpm_logrotate_crond/tasks/logrotate_crond.yml +++ b/roles/edpm_logrotate_crond/tasks/logrotate_crond.yml @@ -26,11 +26,19 @@ logrotate_crond: "{{ lookup('file', 'files/logrotate_crond.yaml') | from_yaml }}" when: not ansible_local.bootc -- name: Manage logrotate crond containers - ansible.builtin.systemd_service: - name: edpm-compute@logrotate_crond - enabled: true - state: started - become: true +- name: Configure logrotate for bootc when: ansible_local.bootc + block: + - name: Render kolla config file + ansible.builtin.copy: + src: files/logrotate_crond.yaml + dest: /var/lib/kolla/config_files/logrotate_crond.json + mode: 0644 + - name: Manage logrotate crond containers + ansible.builtin.systemd_service: + name: edpm-compute@logrotate_crond + enabled: true + state: started + become: true + diff --git a/roles/edpm_logrotate_crond/tasks/run.yml b/roles/edpm_logrotate_crond/tasks/run.yml index aa588514a..fdd3a41c7 100644 --- a/roles/edpm_logrotate_crond/tasks/run.yml +++ b/roles/edpm_logrotate_crond/tasks/run.yml @@ -29,10 +29,18 @@ logrotate_crond: "{{ lookup('file', 'files/logrotate_crond.yaml') | from_yaml }}" when: not ansible_local.bootc -- name: Manage logrotate crond containers - ansible.builtin.systemd_service: - name: edpm-compute@logrotate_crond - enabled: true - state: started - become: true +- name: Configure logrotate for bootc when: ansible_local.bootc + become: true + block: + - name: Render kolla config file + ansible.builtin.copy: + src: files/logrotate_crond.yaml + dest: /var/lib/kolla/config_files/logrotate_crond.json + mode: 0644 + + - name: Manage logrotate crond containers + ansible.builtin.systemd_service: + name: edpm-compute@logrotate_crond + enabled: true + state: started diff --git a/roles/edpm_ovn/tasks/run.yml b/roles/edpm_ovn/tasks/run.yml index cd6c24318..8a2e33c91 100644 --- a/roles/edpm_ovn/tasks/run.yml +++ b/roles/edpm_ovn/tasks/run.yml @@ -53,7 +53,7 @@ block: - name: Render kolla config file for ovn_controller ansible.builtin.template: - src: templates/kolla_ovn_controller.yaml + src: templates/kolla_ovn_controller.yaml.j2 dest: /var/lib/kolla/config_files/ovn_controller.json mode: 0644 diff --git a/roles/edpm_podman/tasks/install.yml b/roles/edpm_podman/tasks/install.yml index de0f8e638..67767f47e 100644 --- a/roles/edpm_podman/tasks/install.yml +++ b/roles/edpm_podman/tasks/install.yml @@ -160,3 +160,13 @@ setype: var_log_t become: true + - name: Ensure /var/lib/kolla/config_files/ exists + ansible.builtin.file: + path: /var/lib/kolla/config_files + state: directory + mode: '0750' + owner: root + group: root + setype: container_file_t + become: true +