kayobe/ansible/roles/dnf/tasks/custom-repo.yml
Jake Hutchinson a36bb614c0 Add loop control to custom DNF repos
This avoids leaking repository credentials by suppressing the dict
output to only print the key.

Change-Id: Ic7aa0e4c4f625908aeb30de65edac8bce96af761
Related-Bug: #2087938
2024-11-13 10:58:13 +01:00

36 lines
1.7 KiB
YAML

---
- name: Install custom repositories
yum_repository:
name: "{{ item.key }}"
description: "{% if 'description' in item.value %}{{ item.value.description }}{% else %}{{ item.key }} repository{% endif %}"
baseurl: "{{ item.value.baseurl | default(omit)}}"
file: "{{ item.value.file | default(omit)}}"
gpgkey: "{{ item.value.gpgkey | default(omit)}}"
gpgcheck: "{{ item.value.gpgcheck | default(omit)}}"
cost: "{{ item.value.cost | default(omit)}}"
enabled: "{{ item.value.enabled | default(omit)}}"
exclude: "{{ item.value.exclude | default(omit)}}"
gpgcakey: "{{ item.value.gpgcakey | default(omit)}}"
includepkgs: "{{ item.value.includepkgs | default(omit)}}"
metadata_expire: "{{ item.value.metadata_expire | default(omit)}}"
metalink: "{{ item.value.metalink | default(omit)}}"
mirrorlist: "{{ item.value.mirrorlist | default(omit)}}"
mirrorlist_expire: "{{ item.value.mirrorlist_expire | default(omit)}}"
password: "{{ item.value.password | default(omit) }}"
priority: "{{ item.value.priority | default(omit)}}"
proxy: "{{ item.value.proxy | default(omit)}}"
proxy_password: "{{ item.value.proxy_password | default(omit)}}"
proxy_username: "{{ item.value.proxy_username | default(omit)}}"
repo_gpgcheck: "{{ item.value.repo_gpgcheck | default(omit)}}"
sslverify: "{{ item.value.sslverify | default(omit)}}"
username: "{{ item.value.username | default(omit) }}"
state: "{{ item.value.state | default(omit)}}"
with_dict: "{{ dnf_custom_repos }}"
loop_control:
label: "{{ item.key }}"
register: register_dnf_command
retries: 3
delay: 10
until: register_dnf_command is success
become: true