homelab/roles/docker/tasks/main.yml

20 lines
383 B
YAML
Raw Normal View History

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