diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2021-04-12 10:24:59 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2021-04-12 10:24:59 -0300 |
commit | 4125e697570733285db172d29d0ba0a32f4141f0 (patch) | |
tree | d17216fb9b63e151f119d9745f130371ae3b98b9 | |
parent | 122afeeb9ea2a917f7f9a086c4921c52d712cdc8 (diff) | |
download | puppet-docker-4125e697570733285db172d29d0ba0a32f4141f0.tar.gz puppet-docker-4125e697570733285db172d29d0ba0a32f4141f0.tar.bz2 |
Fix: requirements and dependencies
-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'], } } |