-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhost.yml.example
54 lines (44 loc) · 1.46 KB
/
host.yml.example
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
---
- hosts: localhost
become: true
tasks:
- name: Install aptitude using apt
apt: name=aptitude state=latest update_cache=yes force_apt_get=yes
- name: Install required system packages
apt: name={{ item }} state=latest update_cache=yes
loop:
[
"apt-transport-https",
"ca-certificates",
"curl",
"software-properties-common",
"python-pip",
"virtualenv",
"python-setuptools",
]
- 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={{ item }} state=latest update_cache=yes
loop: ["docker-ce"]
- name: Install Python Docker Module
pip:
name: docker
- name: install docker-compose
become: True
shell:
cmd: "sudo curl -L https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose "
- name: Change writes for docker-compose binary
become: True
shell:
cmd: "sudo chmod +x /usr/local/bin/docker-compose"
- name: Run container
become: True
shell:
cmd: "sudo docker-compose -f ./docker-compose.yml up -d"