From 84e83df4288975b3b7c6281c644f75c5bfc1ce16 Mon Sep 17 00:00:00 2001 From: irl Date: Mon, 22 Dec 2025 11:05:58 +0000 Subject: [PATCH] fix(podman_host): restart systemd-logind if needed before enabling linger --- roles/podman_host/handlers/main.yml | 6 ++++++ roles/podman_host/tasks/main.yml | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 roles/podman_host/handlers/main.yml 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: