Merge pull request #394 from aurelien-bareille/master

Add flag to deactivate repository configuration
This commit is contained in:
Jeff Geerling 2023-02-02 21:28:43 -06:00 committed by GitHub
commit 67e50e9af0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 2 deletions

View File

@ -47,6 +47,10 @@ Docker Compose Plugin installation options. These differ from the below in that
Docker Compose installation options. Docker Compose installation options.
docker_add_repo: true
Controls whether this role will add the official Docker repository. Set to `false` if you want to use the default docker packages for your system or manage the package repository on your own.
docker_repo_url: https://download.docker.com/linux docker_repo_url: https://download.docker.com/linux
The main Docker repo URL, common between Debian and RHEL systems. The main Docker repo URL, common between Debian and RHEL systems.

View File

@ -26,6 +26,9 @@ docker_compose_arch: "{{ ansible_architecture }}"
docker_compose_url: "https://github.com/docker/compose/releases/download/{{ docker_compose_version }}/docker-compose-linux-{{ docker_compose_arch }}" docker_compose_url: "https://github.com/docker/compose/releases/download/{{ docker_compose_version }}/docker-compose-linux-{{ docker_compose_arch }}"
docker_compose_path: /usr/local/bin/docker-compose docker_compose_path: /usr/local/bin/docker-compose
# Enable repo setup
docker_add_repo: true
# Docker repo URL. # Docker repo URL.
docker_repo_url: https://download.docker.com/linux docker_repo_url: https://download.docker.com/linux

View File

@ -12,6 +12,7 @@
- apt-transport-https - apt-transport-https
- ca-certificates - ca-certificates
state: present state: present
when: docker_add_repo | bool
- name: Ensure additional dependencies are installed (on Ubuntu < 20.04 and any other systems). - name: Ensure additional dependencies are installed (on Ubuntu < 20.04 and any other systems).
apt: apt:
@ -33,18 +34,20 @@
force: true force: true
register: add_repository_key register: add_repository_key
ignore_errors: "{{ docker_apt_ignore_key_error }}" ignore_errors: "{{ docker_apt_ignore_key_error }}"
when: docker_add_repo | bool
- name: Ensure curl is present (on older systems without SNI). - name: Ensure curl is present (on older systems without SNI).
package: name=curl state=present package: name=curl state=present
when: add_repository_key is failed when: add_repository_key is failed and docker_add_repo | bool
- name: Add Docker apt key (alternative for older systems without SNI). - name: Add Docker apt key (alternative for older systems without SNI).
shell: > shell: >
curl -sSL {{ docker_apt_gpg_key }} | apt-key add - curl -sSL {{ docker_apt_gpg_key }} | apt-key add -
when: add_repository_key is failed when: add_repository_key is failed and docker_add_repo | bool
- name: Add Docker repository. - name: Add Docker repository.
apt_repository: apt_repository:
repo: "{{ docker_apt_repository }}" repo: "{{ docker_apt_repository }}"
state: present state: present
update_cache: true update_cache: true
when: docker_add_repo | bool

View File

@ -11,6 +11,7 @@
rpm_key: rpm_key:
key: "{{ docker_yum_gpg_key }}" key: "{{ docker_yum_gpg_key }}"
state: present state: present
when: docker_add_repo | bool
- name: Add Docker repository. - name: Add Docker repository.
get_url: get_url:
@ -19,6 +20,7 @@
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
when: docker_add_repo | bool
- name: Configure Docker Nightly repo. - name: Configure Docker Nightly repo.
ini_file: ini_file:
@ -28,6 +30,7 @@
value: '{{ docker_yum_repo_enable_nightly }}' value: '{{ docker_yum_repo_enable_nightly }}'
mode: 0644 mode: 0644
no_extra_spaces: true no_extra_spaces: true
when: docker_add_repo | bool
- name: Configure Docker Test repo. - name: Configure Docker Test repo.
ini_file: ini_file:
@ -37,6 +40,7 @@
value: '{{ docker_yum_repo_enable_test }}' value: '{{ docker_yum_repo_enable_test }}'
mode: 0644 mode: 0644
no_extra_spaces: true no_extra_spaces: true
when: docker_add_repo | bool
- name: Configure containerd on RHEL 8. - name: Configure containerd on RHEL 8.
block: block: