ansible-role-docker
ansible-role-docker copied to clipboard
Feature Request: Update Repository Configuration to Use yum_repository Module
As a DevOps engineer, I want to configure the repository using the yum_repository module instead of the get_url module. This will ensure that the repository points to our internal Docker proxy server, rather than importing a file that references external mirrors. Current Behavior: The current implementation uses get_url to download a repository file and save it locally:
- name: Add Docker repository.
get_url:
url: "{{ docker_yum_repo_url }}"
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
owner: root
group: root
mode: 0644
when: docker_add_repo | bool
Requested Change: Replace the get_url module with the yum_repository module to define the repository directly within the playbook. Benefits:
- Centralized Configuration: Enables dynamic and maintainable repository management without relying on pre-configured files.
- Alignment with Proxy Server: Ensures repositories directly point to the internal proxy server, avoiding external dependencies.
- Improved Readability: Simplifies understanding of the repository configuration, as it's explicitly defined in the playbook.
Suggested Implementation:
- name: Add Docker repository using yum_repository.
yum_repository:
name: "docker-{{ docker_edition }}"
description: "Docker CE Repository"
baseurl: "{{ docker_proxy_url }}"
gpgkey: "{{ docker_yum_gpg_key }}"
enabled: true
gpgcheck: true
when: docker_add_repo | bool
This change will align our repository management with best practices and internal infrastructure requirements.