From 85d1857f30128ee9732c566ac91c7fbca76d0e24 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Mon, 10 Nov 2025 16:28:32 +0100 Subject: Enable lingering for user This allows the creation and persisting of the /run/user/UID/ directories required for gpg smart-card forwarding agent. --- roles/user/tasks/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/user/tasks/main.yml b/roles/user/tasks/main.yml index a31520df..064e29cf 100644 --- a/roles/user/tasks/main.yml +++ b/roles/user/tasks/main.yml @@ -40,3 +40,10 @@ owner: "{{ username }}" content: | {{ user_public_keys | join('\n') }} + +- name: "Enable lingering for user systemd instance" + become: true + ansible.builtin.command: + cmd: "loginctl enable-linger {{ username }}" + creates: "/var/lib/systemd/linger/{{ username }}" + when: not ansible_is_chroot -- cgit v1.2.3