Add user to docker group

This commit is contained in:
Jake Howard 2020-05-09 20:48:46 +01:00
parent 59a721b243
commit 52ae01d29f
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -3,7 +3,7 @@
name: docker-compose name: docker-compose
become: true become: true
- name: Ensure group "somegroup" exists - name: Create docker group
group: group:
name: "{{ docker_user.name }}" name: "{{ docker_user.name }}"
state: present state: present
@ -25,6 +25,13 @@
append: true append: true
become: true become: true
- name: Add user to docker group
user:
name: "{{ user }}"
groups: "docker"
append: true
become: true
- name: Clean up docker containers - name: Clean up docker containers
cron: cron:
name: clean up docker containers name: clean up docker containers