-
Notifications
You must be signed in to change notification settings - Fork 14
/
playbook_docker.yml
43 lines (38 loc) · 971 Bytes
/
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
---
- 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: set default max logs size to 250MB and set logs rotation
copy:
dest: '/etc/docker/daemon.json'
content: |
{
"log-driver": "json-file",
"log-opts": {
"max-size": "50m",
"max-file": "5"
}
}