diff options
-rw-r--r-- | ChangeLog | 0 | ||||
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | files/docker.gpg | bin | 0 -> 2760 bytes | |||
-rw-r--r-- | manifests/init.pp | 39 |
4 files changed, 43 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index e69de29..0000000 --- a/ChangeLog +++ /dev/null @@ -1,2 +1,4 @@ -docker -====== +Simple docker puppet module +=========================== + +It basically installs docker-ce package. diff --git a/files/docker.gpg b/files/docker.gpg Binary files differnew file mode 100644 index 0000000..e5dc8cf --- /dev/null +++ b/files/docker.gpg diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..64be785 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,39 @@ +# See https://linuxconfig.org/how-to-install-docker-on-debian-9-stretch-linux +class docker { + $distro = downcase($::lsbdistid) + + file { '/etc/apt/trusted.gpg.d/docker.gpg': + ensure => present, + mode => '0644', + owner => 'root', + group => 'root', + source => 'puppet:///modules/docker/docker.gpg', + } + + file { '/etc/apt/sources.list.d/docker.list' : + ensure => present, + owner => "root", + group => "root", + mode => "0644", + content => "deb [arch=amd64] https://download.docker.com/linux/${distro} ${::lsbdistcodename} stable\n", + require => File['/etc/apt/trusted.gpg.d/docker.gpg'], + notify => Exec['docker-apt-auto-update'], + } + + exec { 'docker-apt-auto-update': + command => "/usr/bin/apt-get update", + user => "root", + refreshonly => true, + } + + package { 'docker-ce': + ensure => present, + require => File['/etc/apt/sources.list.d/docker.list'], + } + + service { 'docker' : + ensure => running, + enable => true, + require => Package['docker-ce'], + } +} |