-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook for Docker Compose
68 lines (68 loc) · 1.58 KB
/
playbook for Docker Compose
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
68
hosts: all
become: yes
gather_facts: false
tasks:
- name: Install docker packages
remote_user: ubuntu
apt:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
tags:
- docker
- name: Add Docker s official GPG key
remote_user: ubuntu
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
tags:
- docker
- name: Verify that we have the key with the fingerprint
remote_user: ubuntu
apt_key:
id: 0EBFCD88
state: present
tags:
- docker
- name: Set up the stable repository
remote_user: ubuntu
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
state: present
update_cache: yes
tags:
- docker
- name: Update apt packages
remote_user: ubuntu
apt:
update_cache: yes
tags:
- docker
- name: Install docker
remote_user: ubuntu
apt:
name: docker-ce
state: present
update_cache: yes
#notify: Start docker on boot
tags:
- docker
- name: Add remote "ubuntu" user to "docker" group
remote_user: ubuntu
user:
name: "ubuntu"
group: "docker"
append: yes
tags:
- docker
- name: Install docker-compose
remote_user: ubuntu
get_url:
url : https://github.com/docker/compose/releases/download/1.25.1-rc1/docker-compose-Linux-x86_64
dest: /usr/local/bin/docker-compose
mode: 'u+x,g+x'