You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
976 B
YAML
41 lines
976 B
YAML
2 years ago
|
#- name: Check if docker is already installed
|
||
|
# stat:
|
||
|
# path: /usr/bin/docker
|
||
|
# register: docker_file
|
||
|
|
||
|
- name: Install Packages
|
||
|
# when: docker_file.stat.exists == False
|
||
|
package:
|
||
|
name:
|
||
|
- gpg
|
||
|
- gpg-agent
|
||
|
|
||
|
- name: Add docker-key
|
||
|
apt_key:
|
||
|
url: https://download.docker.com/linux/debian/gpg
|
||
|
state: present
|
||
|
|
||
|
- name: Add docker-repository
|
||
|
apt_repository:
|
||
|
repo: "deb https://download.docker.com/linux/{{ ansible_facts.distribution | lower }} {{ ansible_facts.distribution_release }} stable"
|
||
|
state: present
|
||
|
filename: docker
|
||
|
update_cache: yes
|
||
|
|
||
|
- name: Install docker
|
||
|
package:
|
||
|
name:
|
||
|
- docker-ce
|
||
|
- docker-ce-cli
|
||
|
- containerd.io
|
||
|
- docker-compose-plugin
|
||
|
- pass
|
||
|
state: latest
|
||
|
|
||
|
- name: Deploy docker-compose command to new docker compose plugin
|
||
|
ansible.builtin.copy:
|
||
|
src: docker-compose
|
||
|
dest: "/usr/local/bin/docker-compose"
|
||
|
mode: preserve
|
||
|
|