diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2022-05-24 18:11:38 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2022-05-24 18:11:38 -0300 |
commit | 20b7cb7c949a89f2d6636366554e024b5a0ad0b2 (patch) | |
tree | 979773ad2ef33e947ccba7771f6432f30ee5e42a | |
parent | ae522297fb01471dda1a4fe50d9ffe192b63176e (diff) | |
download | puppet-docker-20b7cb7c949a89f2d6636366554e024b5a0ad0b2.tar.gz puppet-docker-20b7cb7c949a89f2d6636366554e024b5a0ad0b2.tar.bz2 |
Feat: log rotation for docker
-rw-r--r-- | files/daemon.json | 7 | ||||
-rw-r--r-- | manifests/init.pp | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/files/daemon.json b/files/daemon.json new file mode 100644 index 0000000..b8ab8c9 --- /dev/null +++ b/files/daemon.json @@ -0,0 +1,7 @@ +{ + "log-driver": "json-file", + "log-opts": { + "max-size": "10m", + "max-file": "3" + } +} diff --git a/manifests/init.pp b/manifests/init.pp index 55d3258..60c2cf1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -8,4 +8,14 @@ class docker { enable => true, require => Package['docker'], } + + # See https://docs.docker.com/config/containers/logging/json-file/ + file { '/etc/docker/daemon.json': + ensure => present, + owner => root, + group => root, + mode => '0644', + notify => Service['docker'], + source => 'puppet:///modules/docker/daemon.json', + } } |