From 7cb5a35bf9e687ac3dbbc873502579839bf31e22 Mon Sep 17 00:00:00 2001 From: Opnxng Date: Mon, 6 Jan 2025 20:06:25 +0800 Subject: [PATCH] Use ansible_user --- roles/docker/tasks/main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/docker/tasks/main.yaml b/roles/docker/tasks/main.yaml index e49c28b..eb31080 100644 --- a/roles/docker/tasks/main.yaml +++ b/roles/docker/tasks/main.yaml @@ -10,7 +10,7 @@ - name: Create Docker directory file: - path: "/home/{{ user }}/Docker" + path: "/home/{{ ansible_user }}/Docker" state: directory owner: 1000 group: 1000 @@ -23,9 +23,9 @@ path: /var/run/docker.sock mode: 0666 -- name: Add user to Docker group +- name: Add ansible_user to Docker group user: - name: "{{ user }}" + name: "{{ ansible_user }}" groups: docker append: true