-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
64 lines (55 loc) · 1.55 KB
/
playbook.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
---
- hosts: all
become: yes
tasks:
- stat:
path: /usr/bin/docker
register: st
- name: Update repositories
apt:
upgrade: yes
update_cache: yes
when: st.stat.exists == False
- name: Install a list of packages
apt:
name: "{{ packages }}"
vars:
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
when: st.stat.exists == False
- name: Add an Apt signing key, uses whichever key is at the URL
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
when: st.stat.exists == False
- name: add nginx apt repository
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
state: present
when: st.stat.exists == False
- name: Update repositories
apt:
upgrade: yes
update_cache: yes
when: st.stat.exists == False
- name: Install a list of packages
apt:
name: "{{ packages }}"
vars:
packages:
- docker-ce
- docker-ce-cli
- containerd.io
when: st.stat.exists == False
- stat:
path: /usr/local/bin/docker-compose
register: stcomp
- name: Install docker-compose
command: curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
when: stcomp.stat.exists == False
- docker_service:
project_src: .