aboutsummaryrefslogtreecommitdiff
path: root/roles/host/tasks/linger.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/host/tasks/linger.yml')
-rw-r--r--roles/host/tasks/linger.yml8
1 files changed, 8 insertions, 0 deletions
diff --git a/roles/host/tasks/linger.yml b/roles/host/tasks/linger.yml
new file mode 100644
index 0000000..dffc6a7
--- /dev/null
+++ b/roles/host/tasks/linger.yml
@@ -0,0 +1,8 @@
+- name: Confirm systemd-linger is set for containers user
+ ansible.builtin.stat:
+ path: "/var/lib/systemd/linger/{{ host_containers_user }}"
+ register: linger
+
+- name: Set systemd-linger for containers user (if necessary)
+ ansible.builtin.shell: "loginctl enable-linger {{ host_containers_user }}"
+ when: not linger.stat.exists