2022-05-20 01:06:34 +00:00
|
|
|
- name: Install Docker
|
2019-09-18 02:32:08 +00:00
|
|
|
apt:
|
2022-05-20 01:06:34 +00:00
|
|
|
name: ['docker.io', 'docker-compose']
|
2019-09-18 02:32:08 +00:00
|
|
|
state: present
|
|
|
|
update_cache: true
|
|
|
|
|
2020-09-03 01:21:14 +00:00
|
|
|
- name: Add users to docker group
|
2019-09-18 02:32:08 +00:00
|
|
|
user:
|
2020-09-03 01:21:14 +00:00
|
|
|
name: "{{ item }}"
|
2019-09-18 02:32:08 +00:00
|
|
|
groups: docker
|
2020-08-01 00:52:57 +00:00
|
|
|
append: true
|
2020-09-03 01:21:14 +00:00
|
|
|
loop: "{{ docker_users }}"
|
2020-11-22 05:46:08 +00:00
|
|
|
when: docker_users is defined
|
2019-09-18 02:32:08 +00:00
|
|
|
|
2020-08-01 00:52:57 +00:00
|
|
|
- name: Start Docker and enable on boot
|
|
|
|
service:
|
|
|
|
name: docker
|
|
|
|
state: started
|
|
|
|
enabled: true
|