diff options
-rw-r--r-- | manifests/ce.pp | 16 | ||||
-rw-r--r-- | manifests/compose/upstream.pp | 5 | ||||
-rw-r--r-- | manifests/init.pp | 5 |
3 files changed, 21 insertions, 5 deletions
diff --git a/manifests/ce.pp b/manifests/ce.pp index dc7eec4..25a2204 100644 --- a/manifests/ce.pp +++ b/manifests/ce.pp @@ -1,4 +1,4 @@ -# See https://linuxconfig.org/how-to-install-docker-on-debian-9-stretch-linux +# See https://docs.docker.com/engine/install/debian/ class docker::ce inherits docker { $distro = downcase($::lsbdistid) @@ -26,11 +26,21 @@ class docker::ce inherits docker { refreshonly => true, } - Package['docker'] { - name => 'docker-ce', + # Docker community edition + package { 'docker-ce': + ensure => present, require => [ File['/etc/apt/sources.list.d/docker.list'], Exec['docker-apt-auto-update'], ], } + + # Ensure that the distro package is absent + Package['docker'] { + ensure => absent, + } + + Service['docker'] { + require => Package['docker-ce'], + } } diff --git a/manifests/compose/upstream.pp b/manifests/compose/upstream.pp index c1cd20c..846b89d 100644 --- a/manifests/compose/upstream.pp +++ b/manifests/compose/upstream.pp @@ -1,3 +1,4 @@ +# See https://docs.docker.com/compose/install/ class docker::compose::upstream( $version = '1.29.0', ) { @@ -9,4 +10,8 @@ class docker::compose::upstream( command => "/usr/bin/curl -L \"${url}\" -o ${dest} && chmod +x ${dest}", creates => "${dest}", } + + package { 'docker-compose': + ensure => absent, + } } diff --git a/manifests/init.pp b/manifests/init.pp index 85838af..9e08997 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,7 +4,8 @@ class docker { } service { 'docker' : - ensure => running, - enable => true, + ensure => running, + enable => true, + require => Package['docker'], } } |