Initial commit with not yet working docker networking
Signed-off-by: TuDatTr <tuan-dat.tran@tudattr.dev>
This commit is contained in:
25
roles/docker/tasks/user_group_setup.yml
Normal file
25
roles/docker/tasks/user_group_setup.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
- 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
|
||||
Reference in New Issue
Block a user