summaryrefslogtreecommitdiffstats
path: root/roles/user
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-11-10 16:28:32 +0100
committerAhmed Abdelhalim <[email protected]>2025-11-10 16:28:32 +0100
commit85d1857f30128ee9732c566ac91c7fbca76d0e24 (patch)
tree6e8b1b054362c491b09d11fb3912d4a21c45fc4a /roles/user
parentd1b3f8c46190baab08b648318ce7f0492d86b6c9 (diff)
Enable lingering for user
This allows the creation and persisting of the /run/user/UID/ directories required for gpg smart-card forwarding agent.
Diffstat (limited to 'roles/user')
-rw-r--r--roles/user/tasks/main.yml7
1 files changed, 7 insertions, 0 deletions
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