forked from HPC/HPCplaybooks
Setup log rotation for docker.
This commit is contained in:
parent
8be6056f96
commit
d68ec10d2c
7
roles/docker/files/daemon.json
Normal file
7
roles/docker/files/daemon.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"log-driver": "json-file",
|
||||
"log-opts": {
|
||||
"max-size": "10m",
|
||||
"max-file": "10"
|
||||
}
|
||||
}
|
@ -15,10 +15,16 @@
|
||||
- name: install docker
|
||||
apt: pkg={{ item }} state=latest
|
||||
with_items:
|
||||
- docker-engine
|
||||
- python-docker
|
||||
- docker-engine
|
||||
- python-docker
|
||||
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'xenial'
|
||||
|
||||
- name: Setup log rotation.
|
||||
copy:
|
||||
src: files/daemon.json
|
||||
dest: /etc/docker/daemon.json
|
||||
tags: ['settings']
|
||||
|
||||
- name: make sure service is started
|
||||
systemd:
|
||||
name: docker.service
|
Loading…
Reference in New Issue
Block a user