[rootless docker] Lookup XDG_RUNTIME_DIR variable properly

This commit is contained in:
John Robbins 2023-04-10 19:54:28 -06:00
parent 0eef25269a
commit 5685a017bb

View File

@ -36,10 +36,10 @@
scope: user
- name: Decouple rootless docker from user session
command: loginctl enable-linger {{ ansible_user }}
command: "loginctl enable-linger {{ ansible_user }}"
- name: Add DOCKER_HOST to systemwide environment file
lineinfile:
path: /etc/environment
insertafter: EOF
line: 'DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock'
line: "DOCKER_HOST=unix://{{ lookup('env', 'XDG_RUNTIME_DIR') }}/docker.sock"