-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp-server.yml
43 lines (37 loc) · 1020 Bytes
/
app-server.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
---
- hosts: app
gather_facts: no
remote_user: '{{ ssh_user }}'
become: '{{ use_sudo }}'
tasks:
- name: add docker apt key
apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
- name: add docker official repository
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/debian {{ debian_version }} stable
state: present
- name: install prerequisites
notify: restart fail2ban
apt:
update_cache: yes
state: latest
pkg:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
- name: install docker
notify: restart docker
apt:
state: latest
pkg:
- docker-ce
- name: ensure docker is enabled
service: name=docker enabled=yes
notify: restart docker
handlers:
- name: restart docker
action: service name=docker state=restarted