From 4b6892ece92526de4dddf9c751ff96e9a4b78e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Unai=20Arr=C3=ADen?= Date: Fri, 11 Mar 2022 11:45:07 +0100 Subject: [PATCH] =?UTF-8?q?Add=20epoch=20to=20docker-ce=20and=20docker-ce-?= =?UTF-8?q?cli=20packages=20to=20ensure=20docker=20up=E2=80=A6=20(#8618)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add epoch to docker-ce and docker-ce-cli packages to ensure docker upgrade * Split container-engine redhat vars to support legacy RHEL 7 version management * Support ansible_distribution_major_version when disvering vars with ansible_os_family --- roles/container-engine/docker/tasks/main.yml | 1 + .../container-engine/docker/vars/redhat-7.yml | 39 +++++++++++++++++++ roles/container-engine/docker/vars/redhat.yml | 20 +++++----- 3 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 roles/container-engine/docker/vars/redhat-7.yml diff --git a/roles/container-engine/docker/tasks/main.yml b/roles/container-engine/docker/tasks/main.yml index 05784e912..e0eae172c 100644 --- a/roles/container-engine/docker/tasks/main.yml +++ b/roles/container-engine/docker/tasks/main.yml @@ -21,6 +21,7 @@ - "{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version|lower|replace('/', '_') }}.yml" - "{{ ansible_distribution|lower }}-{{ host_architecture }}.yml" - "{{ ansible_distribution|lower }}.yml" + - "{{ ansible_os_family|lower }}-{{ ansible_distribution_major_version|lower|replace('/', '_') }}.yml" - "{{ ansible_os_family|lower }}-{{ host_architecture }}.yml" - "{{ ansible_os_family|lower }}.yml" - defaults.yml diff --git a/roles/container-engine/docker/vars/redhat-7.yml b/roles/container-engine/docker/vars/redhat-7.yml new file mode 100644 index 000000000..d4569b80d --- /dev/null +++ b/roles/container-engine/docker/vars/redhat-7.yml @@ -0,0 +1,39 @@ +--- +# containerd versions are only relevant for docker +containerd_versioned_pkg: + 'latest': "{{ containerd_package }}" + '1.3.7': "{{ containerd_package }}-1.3.7-3.1.el7" + '1.3.9': "{{ containerd_package }}-1.3.9-3.1.el7" + '1.4.3': "{{ containerd_package }}-1.4.3-3.2.el7" + '1.4.4': "{{ containerd_package }}-1.4.4-3.1.el7" + '1.4.6': "{{ containerd_package }}-1.4.6-3.1.el7" + '1.4.9': "{{ containerd_package }}-1.4.9-3.1.el7" + '1.4.12': "{{ containerd_package }}-1.4.12-3.1.el7" + 'stable': "{{ containerd_package }}-1.4.12-3.1.el7" + 'edge': "{{ containerd_package }}-1.4.12-3.1.el7" + +# https://docs.docker.com/engine/installation/linux/centos/#install-from-a-package +# https://download.docker.com/linux/centos/>/x86_64/stable/Packages/ +# or do 'yum --showduplicates list docker-engine' +docker_versioned_pkg: + 'latest': docker-ce + '18.09': docker-ce-18.09.9-3.el7 + '19.03': docker-ce-19.03.15-3.el7 + '20.10': docker-ce-20.10.11-3.el7 + 'stable': docker-ce-20.10.11-3.el7 + 'edge': docker-ce-20.10.11-3.el7 + +docker_cli_versioned_pkg: + 'latest': docker-ce-cli + '18.09': docker-ce-cli-18.09.9-3.el7 + '19.03': docker-ce-cli-19.03.15-3.el7 + '20.10': docker-ce-cli-20.10.11-3.el7 + 'stable': docker-ce-cli-20.10.11-3.el7 + 'edge': docker-ce-cli-20.10.11-3.el7 + +docker_package_info: + enablerepo: "docker-ce" + pkgs: + - "{{ containerd_versioned_pkg[docker_containerd_version | string] }}" + - "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}" + - "{{ docker_versioned_pkg[docker_version | string] }}" diff --git a/roles/container-engine/docker/vars/redhat.yml b/roles/container-engine/docker/vars/redhat.yml index d21babc51..b14a58509 100644 --- a/roles/container-engine/docker/vars/redhat.yml +++ b/roles/container-engine/docker/vars/redhat.yml @@ -17,19 +17,19 @@ containerd_versioned_pkg: # or do 'yum --showduplicates list docker-engine' docker_versioned_pkg: 'latest': docker-ce - '18.09': docker-ce-18.09.9-3.el7 - '19.03': docker-ce-19.03.15-3.el{{ ansible_distribution_major_version }} - '20.10': docker-ce-20.10.11-3.el{{ ansible_distribution_major_version }} - 'stable': docker-ce-20.10.11-3.el{{ ansible_distribution_major_version }} - 'edge': docker-ce-20.10.11-3.el{{ ansible_distribution_major_version }} + '18.09': docker-ce-3:18.09.9-3.el7 + '19.03': docker-ce-3:19.03.15-3.el{{ ansible_distribution_major_version }} + '20.10': docker-ce-3:20.10.11-3.el{{ ansible_distribution_major_version }} + 'stable': docker-ce-3:20.10.11-3.el{{ ansible_distribution_major_version }} + 'edge': docker-ce-3:20.10.11-3.el{{ ansible_distribution_major_version }} docker_cli_versioned_pkg: 'latest': docker-ce-cli - '18.09': docker-ce-cli-18.09.9-3.el7 - '19.03': docker-ce-cli-19.03.15-3.el{{ ansible_distribution_major_version }} - '20.10': docker-ce-cli-20.10.11-3.el{{ ansible_distribution_major_version }} - 'stable': docker-ce-cli-20.10.11-3.el{{ ansible_distribution_major_version }} - 'edge': docker-ce-cli-20.10.11-3.el{{ ansible_distribution_major_version }} + '18.09': docker-ce-cli-1:18.09.9-3.el7 + '19.03': docker-ce-cli-1:19.03.15-3.el{{ ansible_distribution_major_version }} + '20.10': docker-ce-cli-1:20.10.11-3.el{{ ansible_distribution_major_version }} + 'stable': docker-ce-cli-1:20.10.11-3.el{{ ansible_distribution_major_version }} + 'edge': docker-ce-cli-1:20.10.11-3.el{{ ansible_distribution_major_version }} docker_package_info: enablerepo: "docker-ce"