diff --git a/README.md b/README.md index 7bdc4837..20e5723f 100644 --- a/README.md +++ b/README.md @@ -62,14 +62,6 @@ class { 'docker': } ``` -Using a version prior to 17.06, configures and installs from the old repositories: - -```puppet -class { 'docker': - version => '1.12.0-0~wheezy', -} -``` - Docker provides a enterprise addition of the [Docker Engine](https://www.docker.com/enterprise-edition), called Docker EE. To install Docker EE on Debian systems, add the following code to the manifest file: ```puppet @@ -77,7 +69,6 @@ class { 'docker': docker_ee => true, docker_ee_source_location => 'https://', docker_ee_key_source => 'https://', - docker_ee_key_id => '', } ``` @@ -1024,7 +1015,7 @@ This module supports: * Windows Server 2019 (Docker Enterprise Edition only) * Windows Server 2022 (Docker Enterprise Edition only) -On RedHat 7 the default docker package installs docker server version 1.13.1. The default docker.service uses the docker-storage-service in this version and creates /etc/sysconfig/docker-storage based on the container-storage-setup configuration and /etc/sysconfig/docker-storage-setup file. As the puppetlabs-docker module manages both the docker-storage and docker-storage-setup files it causes a conflict with the container-storage-setup forcing a docker service restart, therefore a workaround was included in the service manifest that disables the service restart on storage configuration changes for this version of docker on RedHat 7. As a side effect of these changes, storage configuration changes with this docker version on RedHat 7 are not picked up by default by the docker.service. +On RedHat 7 the default docker package installs docker server version 1.13.1. The default docker.service uses the docker-storage-service in this version and creates /etc/sysconfig/docker-storage based on the container-storage-setup configuration and /etc/sysconfig/docker-storage-setup file. As the puppetlabs-docker module manages both the docker-storage and docker-storage-setup files it causes a conflict with the container-storage-setup forcing a docker service restart, therefore a workaround was included in the service manifest that disables the service restart on storage configuration changes for this version of docker on RedHat 7. As a side effect of these changes, storage configuration changes with this docker version on RedHat 7 are not picked up by default by the docker.service. ## License diff --git a/manifests/init.pp b/manifests/init.pp index 29984e62..20491855 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -312,12 +312,10 @@ # @param docker_ce_cli_package_name # @param docker_ce_source_location # @param docker_ce_key_source -# @param docker_ce_key_id # @param docker_ce_release # @param docker_package_location # @param docker_package_key_source # @param docker_package_key_check_source -# @param docker_package_key_id # @param docker_package_release # @param docker_engine_start_command # @param docker_engine_package_name @@ -326,7 +324,6 @@ # @param docker_ee_package_name # @param docker_ee_source_location # @param docker_ee_key_source -# @param docker_ee_key_id # @param docker_ee_repos # @param docker_ee_release # @param package_release @@ -359,12 +356,10 @@ String[1] $docker_ce_cli_package_name = $docker::params::docker_ce_cli_package_name, Optional[String] $docker_ce_source_location = $docker::params::package_ce_source_location, Optional[String] $docker_ce_key_source = $docker::params::package_ce_key_source, - Optional[String] $docker_ce_key_id = $docker::params::package_ce_key_id, Optional[String] $docker_ce_release = $docker::params::package_ce_release, Optional[String] $docker_package_location = $docker::params::package_source_location, Optional[String] $docker_package_key_source = $docker::params::package_key_source, Optional[Boolean] $docker_package_key_check_source = $docker::params::package_key_check_source, - Optional[String] $docker_package_key_id = $docker::params::package_key_id, Optional[String] $docker_package_release = $docker::params::package_release, String $docker_engine_start_command = $docker::params::docker_engine_start_command, String $docker_engine_package_name = $docker::params::docker_engine_package_name, @@ -373,7 +368,6 @@ Optional[String] $docker_ee_package_name = $docker::params::package_ee_package_name, Optional[String] $docker_ee_source_location = $docker::params::package_ee_source_location, Optional[String] $docker_ee_key_source = $docker::params::package_ee_key_source, - Optional[String] $docker_ee_key_id = $docker::params::package_ee_key_id, Optional[String] $docker_ee_repos = $docker::params::package_ee_repos, Optional[String] $docker_ee_release = $docker::params::package_ee_release, Optional[Variant[String,Array[String]]] $tcp_bind = $docker::params::tcp_bind, @@ -548,7 +542,6 @@ $package_location = $docker::docker_ee_source_location $package_key_source = $docker::docker_ee_key_source $package_key_check_source = $docker_package_key_check_source - $package_key = $docker::docker_ee_key_id $package_repos = $docker::docker_ee_repos $release = $docker::docker_ee_release $docker_start_command = $docker::docker_ee_start_command @@ -558,7 +551,6 @@ 'Debian' : { $package_location = $docker_ce_source_location $package_key_source = $docker_ce_key_source - $package_key = $docker_ce_key_id $package_repos = $docker_ce_channel $release = $docker_ce_release } @@ -586,7 +578,6 @@ $package_location = $docker_package_location $package_key_source = $docker_package_key_source $package_key_check_source = $docker_package_key_check_source - $package_key = $docker_package_key_id $package_repos = 'main' $release = $docker_package_release } diff --git a/manifests/params.pp b/manifests/params.pp index 86984dd9..59207e1c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -13,7 +13,6 @@ $docker_ee_start_command = 'dockerd' $docker_ee_source_location = undef $docker_ee_key_source = undef - $docker_ee_key_id = undef $docker_ee_repos = stable $tcp_bind = undef $tls_enable = false @@ -163,7 +162,6 @@ $package_ce_source_location = "https://download.docker.com/linux/${os_lc}" $package_ce_key_source = "https://download.docker.com/linux/${os_lc}/gpg" - $package_ce_key_id = '9DC858229FC7DD38854AE2D88D81803C0EBFCD88' if (versioncmp($facts['facterversion'], '2.4.6') <= 0) { $package_ce_release = $facts['os']['lsb']['distcodename'] } else { @@ -172,10 +170,8 @@ $package_source_location = 'http://apt.dockerproject.org/repo' $package_key_source = 'https://apt.dockerproject.org/gpg' $package_key_check_source = undef - $package_key_id = '58118E89F3A912897C070ADBF76221572C52609D' $package_ee_source_location = $docker_ee_source_location $package_ee_key_source = $docker_ee_key_source - $package_ee_key_id = $docker_ee_key_id if (versioncmp($facts['facterversion'], '2.4.6') <= 0) { $package_ee_release = $facts['os']['lsb']['distcodename'] } else { @@ -206,18 +202,15 @@ $apt_source_pin_level = undef $detach_service_in_init = false - $package_ce_key_id = undef $package_ce_key_source = 'https://download.docker.com/linux/centos/gpg' $package_ce_release = undef $package_ce_source_location = "https://download.docker.com/linux/centos/${facts['os']['release']['major']}/${facts['os']['architecture']}/${docker_ce_channel}" - $package_ee_key_id = $docker_ee_key_id $package_ee_key_source = $docker_ee_key_source $package_ee_package_name = $docker_ee_package_name $package_ee_release = undef $package_ee_repos = $docker_ee_repos $package_ee_source_location = $docker_ee_source_location $package_key_check_source = true - $package_key_id = undef $package_key_source = 'https://yum.dockerproject.org/gpg' $package_release = undef $package_source_location = "https://yum.dockerproject.org/repo/main/centos/${facts['os']['release']['major']}" @@ -242,10 +235,8 @@ $docker_group = 'docker' $package_ce_source_location = undef $package_ce_key_source = undef - $package_ce_key_id = undef $package_ce_repos = undef $package_ce_release = undef - $package_key_id = undef $package_release = undef $package_source_location = undef $package_key_source = undef @@ -253,7 +244,6 @@ $package_ee_source_location = undef $package_ee_package_name = $docker_ee_package_name $package_ee_key_source = undef - $package_ee_key_id = undef $package_ee_repos = undef $package_ee_release = undef $use_upstream_package_source = undef @@ -279,17 +269,14 @@ $package_key_source = undef $package_key_check_source = undef $package_source_location = undef - $package_key_id = undef $package_repos = undef $package_release = undef $package_ce_key_source = undef $package_ce_source_location = undef - $package_ce_key_id = undef $package_ce_repos = undef $package_ce_release = undef $package_ee_source_location = undef $package_ee_key_source = undef - $package_ee_key_id = undef $package_ee_release = undef $package_ee_repos = undef $package_ee_package_name = undef @@ -319,17 +306,14 @@ $package_key_source = undef $package_key_check_source = undef $package_source_location = undef - $package_key_id = undef $package_repos = undef $package_release = undef $package_ce_key_source = undef $package_ce_source_location = undef - $package_ce_key_id = undef $package_ce_repos = undef $package_ce_release = undef $package_ee_source_location = undef $package_ee_key_source = undef - $package_ee_key_id = undef $package_ee_release = undef $package_ee_repos = undef $package_ee_package_name = undef diff --git a/manifests/repos.pp b/manifests/repos.pp index b6c6a7a3..af42f452 100644 --- a/manifests/repos.pp +++ b/manifests/repos.pp @@ -19,7 +19,6 @@ case $facts['os']['family'] { 'Debian': { $release = $docker::release - $package_key = $docker::package_key $package_repos = $docker::package_repos if ($docker::use_upstream_package_source) { @@ -29,7 +28,7 @@ release => $release, repos => $package_repos, key => { - id => $package_key, + name => 'docker.asc', source => $key_source, }, include => { @@ -52,21 +51,12 @@ if $docker::manage_package { include apt - - if (versioncmp($facts['facterversion'], '2.4.6') <= 0) { - if $facts['os']['name'] == 'Debian' and $facts['os']['lsb']['distcodename'] == 'wheezy' { - include apt::backports - } - } else { - if $facts['os']['name'] == 'Debian' and $facts['os']['distro']['codename'] == 'wheezy' { - include apt::backports - } - } Exec['apt_update'] -> Package[$docker::prerequired_packages] Apt::Source['docker'] -> Package['docker'] } } } + 'RedHat': { if ($docker::manage_package) { $baseurl = $location @@ -85,6 +75,7 @@ } } } + default: {} } } diff --git a/metadata.json b/metadata.json index 1e8b23d0..700148b0 100644 --- a/metadata.json +++ b/metadata.json @@ -14,7 +14,7 @@ }, { "name": "puppetlabs/apt", - "version_requirement": ">= 4.4.1 < 10.0.0" + "version_requirement": ">= 9.2.0 < 10.0.0" }, { "name": "puppetlabs/powershell", diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index dc072224..345f93b6 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -86,14 +86,12 @@ 'dns_search' => defaults['dns_search'], 'dns' => defaults['dns'], 'docker_ce_channel' => defaults['docker_ce_channel'], - 'docker_ce_key_id' => defaults['package_ce_key_id'], 'docker_ce_key_source' => defaults['package_ce_key_source'], 'docker_ce_package_name' => defaults['docker_ce_package_name'], 'docker_ce_cli_package_name' => defaults['docker_ce_cli_package_name'], 'docker_ce_release' => defaults['package_ce_release'], 'docker_ce_source_location' => defaults['package_ce_source_location'], 'docker_ce_start_command' => defaults['docker_ce_start_command'], - 'docker_ee_key_id' => defaults['package_ee_key_id'], 'docker_ee_key_source' => defaults['package_ee_key_source'], 'docker_ee_package_name' => defaults['package_ee_package_name'], 'docker_ee_release' => defaults['package_ee_release'], @@ -105,7 +103,6 @@ 'docker_group' => defaults['docker_group'], 'docker_msft_provider_version' => defaults['docker_msft_provider_version'], 'docker_package_key_check_source' => defaults['package_key_check_source'], - 'docker_package_key_id' => defaults['package_key_id'], 'docker_package_key_source' => defaults['package_key_source'], 'docker_package_location' => defaults['package_source_location'], 'docker_package_release' => defaults['package_release'], diff --git a/spec/shared_examples/repos.rb b/spec/shared_examples/repos.rb index 8330f8ee..f19cb8b5 100644 --- a/spec/shared_examples/repos.rb +++ b/spec/shared_examples/repos.rb @@ -65,12 +65,6 @@ expect(subject).to contain_class('apt') } - if facts[:os]['name'] == 'Debian' && facts[:os]['distro']['codename'] == 'wheezy' - it { - expect(subject).to contain_class('apt::backports') - } - end - it { params['prerequired_packages'].each do |package| expect(subject).to contain_exec('apt_update').that_comes_before("package[#{package}]")