diff options
-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', + } } |