aboutsummaryrefslogtreecommitdiff
path: root/roles/host/tasks/linger.yml
diff options
context:
space:
mode:
authorspmfox <spmfox@foxwd.com>2024-08-27 17:34:55 -0400
committerspmfox <spmfox@foxwd.com>2024-08-27 17:34:55 -0400
commit5ca4fbf2cfe781efedc7c078acaa826c6ad39b10 (patch)
tree598ff2c8b51948091ffa1eb1fbb6ef6f7b26b776 /roles/host/tasks/linger.yml
parent4aa6b11581718f66e711bf26fbb41e96fa3a4661 (diff)
converting to roles, converting from runlabels to quadlet ~ breaking change
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