-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstallDocker&DockerCompose.yml
67 lines (57 loc) · 1.61 KB
/
installDocker&DockerCompose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#################################################
# Docker & Docker-Compose Installation Playbook #
#################################################
---
- name: Install Docker & Docker Compose
hosts: localhost
tasks:
- name: Remove old Docker installations, if any
become: yes
apt:
pkg:
- docker
- docker-engine
- docker.io
- containerd
- runc
state: absent
- name: Remove Update Upgrade dependencies
become: yes
apt:
autoremove: yes
update_cache: yes
upgrade: yes
- name: Install packages
become: yes
apt:
pkg:
- apt-transport-https
- ca-certificates
- curl
- gnupg
- gnupg-agent
- software-properties-common
- name: Add Docker GPG apt Key
become: yes
apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
- name: Add Docker Repository
become: yes
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/debian {{ ansible_lsb.codename }} stable
state: present
update_cache: yes
- name: Install Docker Engine
become: yes
apt:
pkg:
- docker-ce
- docker-ce-cli
- containerd.io
- name: Install Docker Compose
become: yes
get_url:
url: https://github.com/docker/compose/releases/download/1.28.5/docker-compose-Linux-x86_64
dest: /usr/local/bin/docker-compose
mode: 0755