aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-11-09 16:38:47 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-11-09 16:38:47 -0200
commit3d80de9142e829378d547343c1ce50c3ff4d2a47 (patch)
treef8591ce049122d3a01d3eb54c1344cfad3caef1e /manifests
parent909355d9cb3828cae07c1a6323304b9f958c8544 (diff)
downloadpuppet-docker-3d80de9142e829378d547343c1ce50c3ff4d2a47.tar.gz
puppet-docker-3d80de9142e829378d547343c1ce50c3ff4d2a47.tar.bz2
Initial implementation
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp39
1 files changed, 39 insertions, 0 deletions
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'],
+ }
+}