refactor(ansible): use ansible_user_id and add root package condition

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2025-04-27 18:15:07 +02:00
parent 7fcee3912f
commit 8f2998abc0
10 changed files with 39 additions and 25 deletions

View File

@@ -5,9 +5,9 @@
state: present
become: true
- name: Append the group docker to "{{ user }}"
- name: Append the group docker to "{{ ansible_user_id }}"
ansible.builtin.user:
name: "{{ user }}"
name: "{{ ansible_user_id }}"
shell: /bin/bash
groups: docker
append: true