Add flag to skip updating repo when they have been pre-configured

This commit is contained in:
Adam Tetelman 2019-05-08 18:13:37 -07:00
parent c73e2f6d8f
commit e9a491f84e
3 changed files with 11 additions and 2 deletions

View File

@ -28,3 +28,6 @@ docker_yum_repo_enable_test: 0
# A list of users who will be added to the docker group.
docker_users: []
# Update repositories to be used for download/install
docker_add_repo: true

View File

@ -22,10 +22,11 @@
ignore_errors: "{{ docker_apt_ignore_key_error }}"
tags:
- configure_docker_repo
when: docker_add_repo
- name: Ensure curl is present (on older systems without SNI).
package: name=curl state=present
when: add_repository_key is failed
when: docker_add_repo and add_repository_key is failed
- name: Add Docker apt key (alternative for older systems without SNI).
shell: |
@ -33,7 +34,7 @@
curl -sSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
args:
warn: false
when: add_repository_key is failed
when: docker_add_repo and add_repository_key is failed
tags:
- configure_docker_repo
@ -44,3 +45,4 @@
update_cache: true
tags:
- configure_docker_repo
when: docker_add_repo

View File

@ -13,6 +13,7 @@
state: present
tags:
- configure_docker_repo
when: docker_add_repo
- name: Add Docker repository.
get_url:
@ -23,6 +24,7 @@
mode: 0644
tags:
- configure_docker_repo
when: docker_add_repo
- name: Configure Docker Edge repo.
ini_file:
@ -32,6 +34,7 @@
value: '{{ docker_yum_repo_enable_edge }}'
tags:
- configure_docker_repo
when: docker_add_repo
- name: Configure Docker Test repo.
ini_file:
@ -41,3 +44,4 @@
value: '{{ docker_yum_repo_enable_test }}'
tags:
- configure_docker_repo
when: docker_add_repo