make optional to add the official docker repos

This commit is contained in:
sciCORE 2020-04-30 13:13:38 +02:00
parent c94e327a74
commit 5a35c06173
3 changed files with 58 additions and 44 deletions

View File

@ -15,6 +15,8 @@ docker_compose_version: "1.25.4"
docker_compose_path: /usr/local/bin/docker-compose
# Used only for Debian/Ubuntu. Switch 'stable' to 'edge' if needed.
docker_apt_add_official_repository: true
# options below apply if you add the official repo using this role (which is the default)
docker_apt_release_channel: stable
docker_apt_arch: amd64
docker_apt_repository: "deb [arch={{ docker_apt_arch }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}"
@ -22,6 +24,8 @@ docker_apt_ignore_key_error: true
docker_apt_gpg_key: https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg
# Used only for RedHat/CentOS/Fedora.
docker_yum_add_official_repository: true
# options below apply if you add the official repo using this role (which is the default)
docker_yum_repo_url: https://download.docker.com/linux/{{ (ansible_distribution == "Fedora") | ternary("fedora","centos") }}/docker-{{ docker_edition }}.repo
docker_yum_repo_enable_edge: '0'
docker_yum_repo_enable_test: '0'

View File

@ -14,6 +14,9 @@
- gnupg2
state: present
- name: Add official docker apt repository
block:
- name: Add Docker apt key.
apt_key:
url: "{{ docker_apt_gpg_key }}"
@ -38,3 +41,5 @@
repo: "{{ docker_apt_repository }}"
state: present
update_cache: true
when: docker_apt_add_official_repository

View File

@ -7,6 +7,9 @@
- docker-engine
state: absent
- name: Add official docker yum repository
block:
- name: Add Docker GPG key.
rpm_key:
key: "{{ docker_yum_gpg_key }}"
@ -34,6 +37,8 @@
option: enabled
value: '{{ docker_yum_repo_enable_test }}'
when: docker_yum_add_official_repository
- name: Install containerd separately (CentOS 8).
package:
name: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm