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
This commit is contained in:
Michał Nasiadka 2021-07-28 15:06:55 +02:00 committed by Pierre Riteau
parent 0a55c83465
commit a48cc24988
2 changed files with 7 additions and 1 deletions

View File

@ -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)}}"

View File

@ -0,0 +1,5 @@
---
features:
- |
Adds support for the ``metalink`` option in custom DNF repositories
configured with ``dnf_custom_repos`` in ``dnf.yml``.