diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-11-09 16:38:47 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-11-09 16:38:47 -0200 |
commit | 3d80de9142e829378d547343c1ce50c3ff4d2a47 (patch) | |
tree | f8591ce049122d3a01d3eb54c1344cfad3caef1e | |
parent | 909355d9cb3828cae07c1a6323304b9f958c8544 (diff) | |
download | puppet-docker-3d80de9142e829378d547343c1ce50c3ff4d2a47.tar.gz puppet-docker-3d80de9142e829378d547343c1ce50c3ff4d2a47.tar.bz2 |
Initial implementation
-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'], + } +} |