-
Notifications
You must be signed in to change notification settings - Fork 1
/
playbook.yml
executable file
·69 lines (55 loc) · 2.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#################################################
# Ansible Playbook for docker-rocketchat
#################################################
---
- hosts: all
become: yes
gather_facts: true
vars_files:
- ../vars/default.yml
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', 'python3-pip', 'virtualenv', 'python3-setuptools', 'git', 'wget']
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
- name: Add Docker deb file
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/debian buster stable
state: present
- name: Update apt and install docker-ce
apt: update_cache=yes name=docker-ce state=latest
- name: Install Docker Module for Python
pip:
name: docker
- name: Install docker-compose
pip:
name: docker-compose
- name: Copy our docker-compose.yaml to remote server
git:
repo: https://github.com/cloyne/docker-rocketchat.git
dest: /home/cloyne/rocketchat
- name: Tear down existing services
community.docker.docker_compose:
project_src: /home/cloyne/rocketchat
state: absent
- name: Run 'docker system prune'
community.docker.docker_prune:
containers: yes
images: yes
networks: yes
volumes: yes
builder_cache: yes
- name: Create and start services
community.docker.docker_compose:
project_src: /home/cloyne/rocketchat
- ansible.builtin.debug:
var: output
- name: Run `docker-compose up` again
community.docker.docker_compose:
project_src: /home/cloyne/rocketchat
build: no