From a48cc2498859f5949d304266d32ce3e620ad7f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Nasiadka?= Date: Wed, 28 Jul 2021 15:06:55 +0200 Subject: [PATCH] dnf: add metalink argument to custom dnf repository As per [1] mandatory configuration option is either baseurl, mirrorlist or metalink. EPEL repos use metalink and it's impossible to configure them via DNF custom repos functionality right now. [1]: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/yum_repository_module.html#parameter-metalink Change-Id: Ib267b648f011a7efa6440b6adf9ea8b9b5a0931f --- ansible/roles/dnf/tasks/custom-repo.yml | 3 ++- .../notes/yum-repository-metalink-26afa7c9f7026539.yaml | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/yum-repository-metalink-26afa7c9f7026539.yaml diff --git a/ansible/roles/dnf/tasks/custom-repo.yml b/ansible/roles/dnf/tasks/custom-repo.yml index e5fdbf2e1..cabcb8f9b 100644 --- a/ansible/roles/dnf/tasks/custom-repo.yml +++ b/ansible/roles/dnf/tasks/custom-repo.yml @@ -3,7 +3,7 @@ yum_repository: name: "{{ item.key }}" description: "{% if 'description' in item.value %}{{ item.value.description }}{% else %}{{ item.key }} repository{% endif %}" - baseurl: "{{ item.value.baseurl }}" + baseurl: "{{ item.value.baseurl | default(omit)}}" file: "{{ item.value.file | default(omit)}}" gpgkey: "{{ item.value.gpgkey | default(omit)}}" gpgcheck: "{{ item.value.gpgcheck | default(omit)}}" @@ -11,6 +11,7 @@ enabled: "{{ item.value.enabled | default(omit)}}" gpgcakey: "{{ item.value.gpgcakey | 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)}}" priority: "{{ item.value.priority | default(omit)}}" diff --git a/releasenotes/notes/yum-repository-metalink-26afa7c9f7026539.yaml b/releasenotes/notes/yum-repository-metalink-26afa7c9f7026539.yaml new file mode 100644 index 000000000..f23894eaf --- /dev/null +++ b/releasenotes/notes/yum-repository-metalink-26afa7c9f7026539.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds support for the ``metalink`` option in custom DNF repositories + configured with ``dnf_custom_repos`` in ``dnf.yml``.