diff --git a/roles/tpa_single_node/handlers/main.yml b/roles/tpa_single_node/handlers/main.yml index ed97d539..13b22203 100644 --- a/roles/tpa_single_node/handlers/main.yml +++ b/roles/tpa_single_node/handlers/main.yml @@ -1 +1,5 @@ --- +- name: Reload systemd + ansible.builtin.systemd_service: + name: "{{ item }}" + loop: "{{ services }}" diff --git a/roles/tpa_single_node/tasks/install_manifest.yml b/roles/tpa_single_node/tasks/install_manifest.yml index fa770273..2cae929d 100644 --- a/roles/tpa_single_node/tasks/install_manifest.yml +++ b/roles/tpa_single_node/tasks/install_manifest.yml @@ -22,11 +22,8 @@ mode: "0600" register: copy_systemd_file -- name: Restart Podman Service - ansible.builtin.systemd: - state: restarted - enabled: true - daemon_reload: true - name: "{{ podman_spec.systemd_file }}" - no_block: true - when: copy_manifest.changed or copy_systemd_file.changed +- name: Add {{ podman_spec.systemd_file }} to services list + ansible.builtin.set_fact: + services: "{{ services + [ podman_spec.systemd_file ] }}" + changed_when: true + notify: Reload systemd diff --git a/roles/tpa_single_node/tasks/install_manifest_cronjob.yml b/roles/tpa_single_node/tasks/install_manifest_cronjob.yml index e71d575d..b6273946 100644 --- a/roles/tpa_single_node/tasks/install_manifest_cronjob.yml +++ b/roles/tpa_single_node/tasks/install_manifest_cronjob.yml @@ -25,22 +25,10 @@ src: systemd/timer.j2 dest: "{{ tpa_single_node_systemd_directory + '/' + podman_spec.systemd_file }}.timer" mode: "0600" - register: copy_systemd_timer_file + register: copy_systemd_timer_file045011 -- name: Restart Podman Service - ansible.builtin.systemd: - state: started - enabled: true - daemon_reload: false - name: "{{ podman_spec.systemd_file }}" - no_block: true - when: copy_manifest.changed or copy_systemd_file.changed - -- name: Restart Timer Podman Service - ansible.builtin.systemd: - state: started - enabled: true - daemon_reload: false - name: "{{ podman_spec.systemd_file }}.timer" - no_block: true - when: copy_manifest.changed or copy_systemd_timer_file.changed +- name: Add {{ podman_spec.systemd_file }} to services list + ansible.builtin.set_fact: + services: "{{ services + [ podman_spec.systemd_file ] }}" + changed_when: true + notify: Reload systemd diff --git a/roles/tpa_single_node/tasks/main.yml b/roles/tpa_single_node/tasks/main.yml index 83c3080c..6779d749 100644 --- a/roles/tpa_single_node/tasks/main.yml +++ b/roles/tpa_single_node/tasks/main.yml @@ -15,6 +15,10 @@ - ansible_facts['distribution_major_version'] == '9' - (ansible_facts['distribution_version'] | split('.'))[1] | int >= 3 +- name: Create Services list + ansible.builtin.set_fact: + services: [] + - name: Install Operating System Components ansible.builtin.include_tasks: os.yml when: rhel