CI: Fix installation of legacy Docker packages on CentOS

The Media Temple Docker mirror now includes newer Docker packages from
download.docker.com, which are not signed by the same GPG key. These new
packages obsolete the legacy ones, which means installing docker-engine
fails with the error:

The GPG keys listed for the "Docker Main Repository" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.

 Failing package is: 1:docker-ce-cli-19.03.9-3.el7.x86_64
 GPG Keys are configured as: https://mirrors.aliyun.com/docker-engine/yum/gpg

Switch to another mirror which only has legacy packages.

Change-Id: I260b6a8390bef06d0bd1caa76a276818b3f7bb56
This commit is contained in:
Pierre Riteau 2020-06-08 14:58:46 +02:00
parent 4a214ab091
commit f8b8e23db8
2 changed files with 8 additions and 4 deletions

View File

@ -8,9 +8,9 @@ docker_apt_key_id: "{{ 'C32DA102AD89C2BE' if ansible_architecture == 'aarch64' e
docker_yum_url: "https://mirrors.aliyun.com/docker-engine/yum"
docker_gpg_fingerprint: "58118E89F3A912897C070ADBF76221572C52609D"
# Partial mirror of legacy YUM Docker repository. Only contains centos/7 folder
# and no gpg key, but has all binary packages including 17.05.0.
docker_yum_centos_url: "https://mirrors.mediatemple.net/docker"
# Partial mirror of legacy YUM Docker repository. The repodata folder is
# directly under this URL.
docker_yum_centos_url: "https://mirror.its.sfu.ca/mirror/docker"
customize_etc_hosts: True

View File

@ -1,7 +1,11 @@
[docker-repo]
name=Docker main Repository
{% if (ansible_distribution | lower) == 'centos' %}
{% if docker_yum_url == "https://mirrors.aliyun.com/docker-engine/yum" and (ansible_distribution | lower) == 'centos' %}
{% if docker_yum_centos_url == "https://mirror.its.sfu.ca/mirror/docker" %}
baseurl={{ docker_yum_centos_url }}
{% else %}
baseurl={{ docker_yum_centos_url }}/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version | lower }}
{% endif %}
{% else %}
baseurl={{ docker_yum_url }}/repo/main/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version | lower }}
{% endif %}