-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-docker.yml
63 lines (53 loc) · 1.37 KB
/
setup-docker.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
---
- hosts: do_docker
vars:
upgrade_all_packages: false
tasks:
- name: Test connectivity
ping:
- name: Run the equivalent of "apt-get update" as a separate step
apt:
update_cache: yes
- name: Upgrade all packages
apt:
upgrade: dist
when: upgrade_all_packages
- name: Install required packages for Docker
apt:
name:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add Docker Repository
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu bionic stable
state: present
- name: Update apt and install docker-ce
apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
update_cache: yes
state: latest
- name: Start service Docker, if not started
service:
name: docker
state: started
- name: Install Python PIP
apt:
name:
- python3-pip
- python3-setuptools
- name: Install Docker SDK for Python
pip:
name:
- docker >= 1.8.0
- PyYAML >= 3.11
- docker-compose >= 1.7.0