ansible-role-swarm/tasks/install.yml

53 lines
1.1 KiB
YAML

---
- name: install dependencies packages
apt:
name: '{{ packages }}'
vars:
packages:
- apt-transport-https
- ca-certificates
- gnupg2
- software-properties-common
tags: docker
- name: add gpg key for docker repository
apt_key:
url: https://download.docker.com/linux/debian/gpg
tags: docker
- name: add docker repository
apt_repository:
repo: 'deb https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable'
tags: docker
- name: install docker package
apt:
name: '{{ packages }}'
vars:
packages:
- docker-ce
tags: docker
- name: install docker-compose binary
get_url:
url: '{{ docker_compose_url }}'
dest: /usr/bin/docker-compose
checksum: 'sha256:{{ docker_compose_url }}.sha256'
owner: root
group: root
mode: 0755
tags: docker
- name: copy systemd service
copy:
src: docker-compose.service
dest: /etc/systemd/system/docker-compose@.service
owner: root
group: root
mode: 0644
tags: docker
- name: reload systemd
systemd:
daemon_reload: yes
tags: docker