Skip to content

Commit

Permalink
Backport remove dockerproject (#5682)
Browse files Browse the repository at this point in the history
* Remove dockerproject org (#5548)

* Change dockerproject.org to download.docker.com

dockerproject.org was deprecated in 2017 and has gone down.

* Restore yum repo for containerd

Change-Id: I883bb512a2164a85865b1bd4fb569af0358c8c2b

Co-authored-by: Craig Rodrigues <[email protected]>

* remove legacy docker repo in kubernetes/preinstall before any packages installed (#5640)

* Remove dockerproject_.+_repo_.+ variables (#5662)

This 38688a4 change replaces the
value for dockerproject_.+_repo_.+ docker variables but their new
value was previously defined in other variables. This change removes
the dockerproject_.+_repo_.+ docker variables in favor of the older
ones.

* Remove stale legacy yum docker repo /etc/yum.repos.d/docker.repo (#5569)

* Remove stale legacy yum docker repo /etc/yum.repos.d/docker.repo

* move task 'Remove legacy docker repo file' to pre-upgrade.yml

* fix upgrade procedure when in playbook (#5695)

exists role kubernetes/preinstall and not exists role container-engine

 error 'yum_repo_dir' is undefined

Co-authored-by: Matthew Mosesohn <[email protected]>
Co-authored-by: Craig Rodrigues <[email protected]>
Co-authored-by: Victor Morales <[email protected]>
  • Loading branch information
4 people authored Mar 5, 2020
1 parent 366fb08 commit e181530
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 49 deletions.
10 changes: 0 additions & 10 deletions roles/container-engine/containerd/templates/rh_containerd.repo.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,3 @@ keepcache={{ docker_rpm_keepcache | default('1') }}
gpgkey={{ docker_rh_repo_gpgkey }}
{% if http_proxy is defined %}proxy={{ http_proxy }}{% endif %}
{% if ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8 %}module_hotfixes=True{% endif %}

[docker-engine]
name=Docker-Engine Repository
baseurl={{ dockerproject_rh_repo_base_url }}
enabled=1
gpgcheck=1
keepcache={{ docker_rpm_keepcache | default('1') }}
gpgkey={{ dockerproject_rh_repo_gpgkey }}
{% if http_proxy is defined %}proxy={{ http_proxy }}{% endif %}
{% if ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8 %}module_hotfixes=True{% endif %}
9 changes: 9 additions & 0 deletions roles/container-engine/containerd/templates/rh_docker.repo.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[docker-ce]
name=Docker-CE Repository
baseurl={{ docker_rh_repo_base_url }}
enabled=1
gpgcheck=1
keepcache={{ docker_rpm_keepcache | default('1') }}
gpgkey={{ docker_rh_repo_gpgkey }}
{% if http_proxy is defined %}proxy={{ http_proxy }}{% endif %}
{% if ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8 %}module_hotfixes=True{% endif %}
7 changes: 1 addition & 6 deletions roles/container-engine/docker/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ docker_ubuntu_repo_gpgkey: 'https://download.docker.com/linux/ubuntu/gpg'
# Debian docker-ce repo
docker_debian_repo_base_url: "https://download.docker.com/linux/debian"
docker_debian_repo_gpgkey: 'https://download.docker.com/linux/debian/gpg'
# dockerproject repo
dockerproject_rh_repo_base_url: 'https://yum.dockerproject.org/repo/main/centos/7'
dockerproject_rh_repo_gpgkey: 'https://yum.dockerproject.org/gpg'
dockerproject_apt_repo_base_url: 'https://apt.dockerproject.org/repo'
dockerproject_apt_repo_gpgkey: 'https://apt.dockerproject.org/gpg'
docker_bin_dir: "/usr/bin"
# CentOS/RedHat Extras repo
extras_rh_repo_base_url: "http://mirror.centos.org/centos/$releasever/extras/$basearch/"
Expand All @@ -67,4 +62,4 @@ docker_remove_packages_yum:
docker_remove_packages_apt:
- docker
- docker-engine
- docker.io
- docker.io
14 changes: 8 additions & 6 deletions roles/container-engine/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
tags:
- facts

# https://yum.dockerproject.org/repo/main/opensuse/ contains packages for an EOL
# openSUSE version so we can't use it. The only alternative is to use the docker
# packages from the distribution repositories.
- name: Warn about Docker version on SUSE
debug:
msg: "SUSE distributions always install Docker from the distro repos"
Expand Down Expand Up @@ -105,9 +102,14 @@
when: ansible_distribution == "Fedora" and not is_atomic

- name: Configure docker repository on RedHat/CentOS/Oracle Linux
template:
src: "rh_docker.repo.j2"
dest: "{{ yum_repo_dir }}/docker.repo"
yum_repository:
name: docker-ce
baseurl: "{{ docker_rh_repo_base_url }}"
description: "Docker CE Stable - $basearch"
gpgcheck: yes
gpgkey: "{{ docker_rh_repo_gpgkey }}"
keepcache: "{{ docker_rpm_keepcache | default('1') }}"
proxy: " {{ http_proxy | default('_none_') }}"
when: ansible_distribution in ["CentOS","RedHat","OracleLinux"] and not is_atomic

- name: check if container-selinux is available
Expand Down
8 changes: 8 additions & 0 deletions roles/container-engine/docker/tasks/pre-upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
---
- name: Remove legacy docker repo file
file:
path: "{{ yum_repo_dir }}/docker.repo"
state: absent
when:
- ansible_distribution in ["CentOS","RedHat","OracleLinux"]
- not is_atomic

- name: Ensure old versions of Docker are not installed. | Debian
apt:
name: '{{ docker_remove_packages_apt }}'
Expand Down
19 changes: 0 additions & 19 deletions roles/container-engine/docker/templates/rh_docker.repo.j2

This file was deleted.

5 changes: 2 additions & 3 deletions roles/container-engine/docker/vars/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
docker_kernel_min_version: '3.10'

# https://download.docker.com/linux/debian/
# https://apt.dockerproject.org/repo/dists/debian-wheezy/main/filelist
docker_versioned_pkg:
'latest': docker-ce
'1.13': docker-engine=1.13.1-0~debian-{{ ansible_distribution_release|lower }}
Expand Down Expand Up @@ -38,14 +37,14 @@ docker_repo_info:
dockerproject_repo_key_info:
pkg_key: apt_key
url: '{{ dockerproject_apt_repo_gpgkey }}'
url: '{{ docker_debian_repo_gpgkey }}'
repo_keys:
- 58118E89F3A912897C070ADBF76221572C52609D

dockerproject_repo_info:
pkg_repo: apt_repository
repos:
- >
deb {{ dockerproject_apt_repo_base_url }}
deb {{ docker_debian_repo_base_url }}
{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}
main
1 change: 0 additions & 1 deletion roles/container-engine/docker/vars/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ docker_kernel_min_version: '0'

# https://docs.docker.com/engine/installation/linux/centos/#install-from-a-package
# https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
# https://yum.dockerproject.org/repo/main/centos/7
# or do 'yum --showduplicates list docker-engine'
docker_versioned_pkg:
'latest': docker-ce
Expand Down
4 changes: 2 additions & 2 deletions roles/container-engine/docker/vars/ubuntu-amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ docker_repo_info:
dockerproject_repo_key_info:
pkg_key: apt_key
url: '{{ dockerproject_apt_repo_gpgkey }}'
url: '{{ docker_debian_repo_gpgkey }}'
repo_keys:
- 58118E89F3A912897C070ADBF76221572C52609D

dockerproject_repo_info:
pkg_repo: apt_repository
repos:
- >
deb {{ dockerproject_apt_repo_base_url }}
deb {{ docker_debian_repo_base_url }}
{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}
main
4 changes: 2 additions & 2 deletions roles/container-engine/docker/vars/ubuntu-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ docker_repo_info:
dockerproject_repo_key_info:
pkg_key: apt_key
url: '{{ dockerproject_apt_repo_gpgkey }}'
url: '{{ docker_debian_repo_gpgkey }}'
repo_keys:
- 58118E89F3A912897C070ADBF76221572C52609D

dockerproject_repo_info:
pkg_repo: apt_repository
repos:
- >
deb {{ dockerproject_apt_repo_base_url }}
deb {{ docker_debian_repo_base_url }}
{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}
main
2 changes: 2 additions & 0 deletions roles/kubernetes/preinstall/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ etc_hosts_localhost_entries:
# Minimal memory requirement in MB for safety checks
minimal_node_memory_mb: 1024
minimal_master_memory_mb: 1500

yum_repo_dir: /etc/yum.repos.d
8 changes: 8 additions & 0 deletions roles/kubernetes/preinstall/tasks/0070-system-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
tags:
- bootstrap-os

- name: Remove legacy docker repo file
file:
path: "{{ yum_repo_dir }}/docker.repo"
state: absent
when:
- ansible_distribution in ["CentOS","RedHat","OracleLinux"]
- not is_atomic

- name: Install python-dnf for latest RedHat versions
command: dnf install -y python-dnf yum
register: dnf_task_result
Expand Down

0 comments on commit e181530

Please sign in to comment.