diff --git a/roles/podman_host/handlers/main.yml b/roles/podman_host/handlers/main.yml new file mode 100644 index 0000000..77826fe --- /dev/null +++ b/roles/podman_host/handlers/main.yml @@ -0,0 +1,6 @@ +--- +- name: Restart systemd-logind + ansible.builtin.systemd_service: + name: systemd-logind + state: restarted + become: true diff --git a/roles/podman_host/tasks/main.yml b/roles/podman_host/tasks/main.yml index 96254ff..24d9e2e 100644 --- a/roles/podman_host/tasks/main.yml +++ b/roles/podman_host/tasks/main.yml @@ -37,6 +37,7 @@ become: true become_user: "{{ item }}" with_items: "{{ podman_host_rootless_users }}" + notify: Restart systemd-logind - name: Podman Host | PATCH | Set XDG_RUNTIME_DIR in .bashrc for rootless users ansible.builtin.lineinfile: @@ -45,6 +46,10 @@ become: true become_user: "{{ item }}" with_items: "{{ podman_host_rootless_users }}" + notify: Restart systemd-logind + +- name: Podman Host | Flush handlers + ansible.builtin.meta: flush_handlers - name: Podman Host | PATCH | Enable linger for rootless users ansible.builtin.command: