ansible/roles/docker/tasks/user_group_setup.yml
TuDatTr 0ab1c043d6 Initial commit with not yet working docker networking
Signed-off-by: TuDatTr <tuan-dat.tran@tudattr.dev>
2022-11-30 23:49:07 +01:00

26 lines
519 B
YAML

---
- name: Ensure group "docker" exists
group:
name: docker
state: present
become: yes
- name: Append the group "docker" to "{{ user }}" groups
ansible.builtin.user:
name: "{{ user }}"
shell: /bin/bash
groups: docker
append: yes
become: yes
- name: Make sure that the docker folders exists
ansible.builtin.file:
path: "{{ item }}"
owner: "{{ user }}"
group: "{{ user }}"
state: directory
loop:
- "{{docker_compose_dir}}"
- "{{docker_dir}}"
become: yes