-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
45 lines (45 loc) · 1.07 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
---
- hosts: webservers
become: yes
become_method: sudo
tasks:
- name: add docker apt keys
apt_key:
keyserver: hkp://p80.pool.sks-keyservers.net:80
id: 58118E89F3A912897C070ADBF76221572C52609D
- name: update apt
apt_repository:
repo: deb https://apt.dockerproject.org/repo ubuntu-xenial main
state: present
- name: install Docker
apt:
name: docker-engine
update_cache: yes
state: present
- name: add ubuntu to docker group
user:
name: ubuntu
groups: docker
append: yes
- name: install python-pip
apt:
name: python-pip
state: present
- name: install docker-py
pip:
name: docker-py
- name: install Docker Compose
pip:
name: docker-compose
version: 1.9.0
- name: copy docker-compose.yml
copy:
src: ./docker-compose.yml
dest: ./docker-compose.yml
- name: run docker-compose
environment:
BUILD_TIMESTAMP: "{{ lookup('env', 'BUILD_TIMESTAMP') }}"
docker_service:
project_src: .
state: present
restarted: yes