# See https://docs.docker.com/engine/install/debian/ class docker::ce inherits docker { $distro = downcase($::lsbdistid) # Old location file { '/etc/apt/trusted.gpg.d/docker.gpg': ensure => absent, mode => '0644', owner => 'root', group => 'root', source => "puppet:///modules/docker/${distro}.gpg", } file { '/etc/apt/keyrings/docker.gpg': ensure => present, mode => '0644', owner => 'root', group => 'root', source => "puppet:///modules/docker/${distro}.gpg", } file { '/etc/apt/sources.list.d/docker.list': ensure => present, owner => "root", group => "root", mode => "0644", content => "deb [signed-by=/etc/apt/keyrings/docker.gpg arch=${::architecture}] https://download.docker.com/linux/${distro} ${::lsbdistcodename} stable\n", require => File['/etc/apt/keyrings/docker.gpg'], notify => Exec['docker-apt-auto-update'], } exec { 'docker-apt-auto-update': command => "/usr/bin/apt-get update", user => "root", refreshonly => true, } # 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'], } }