-
Notifications
You must be signed in to change notification settings - Fork 14
/
playbook_docker.yml
49 lines (44 loc) · 1.13 KB
/
playbook_docker.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
---
- name: playbook_docker.yml - docker and stuff
hosts: all
become: yes
tasks:
- name: install docker and docker compose and ctop
pacman:
update_cache: yes
name:
- docker
- docker-compose
- ctop
- name: enable and start docker.service
systemd:
name: docker
enabled: yes
state: started
- name: add the user to docker group
user:
name: "{{ ansible_user }}"
groups: docker
append: yes
- name: Create /etc/docker directory if it does not exist
file:
path: /etc/docker
state: directory
mode: '0755'
- name: daemon.json, sets max logs size and prevents docker network getting in to 192.168.0.0
copy:
dest: '/etc/docker/daemon.json'
content: |
{
"log-driver": "json-file",
"log-opts": {
"max-size": "50m",
"max-file": "5"
},
"default-address-pools": [
{
"base" : "172.16.0.0/12",
"size" : 24
}
]
}