vm-ansible/roles/docker/tasks/main.yaml

36 lines
696 B
YAML
Raw Normal View History

---
- name: "Install Docker via apt"
apt:
update_cache: yes
state: present
name:
- docker.io
- docker-compose
- name: Disable userland proxy
copy:
src: daemon.json
dest: /etc/docker/daemon.json
mode: 644
owner: root
- name: Enable and restart Docker daemon
service:
name: docker
state: restarted
enabled: yes
2022-01-10 04:49:15 +01:00
2022-02-05 21:00:03 +01:00
- name: "Add service user to docker group"
ansible.builtin.user:
name: service-user
comment: Service user
groups: docker
append: yes
2022-01-10 04:49:15 +01:00
- name: Copy docker-compose.yml to target
copy:
src: "{{ dockercompose_yml_name }}"
dest: /home/service-user/docker-compose.yml
mode: 600
owner: service-user