Support configuration of yum.conf

Options are configured via the 'yum_config' variable.

Change-Id: Iaf46dbf22e0ad2b9e43926e899ce454d19662cc3
Story: 2004935
Task: 29327
This commit is contained in:
Mark Goddard 2019-02-04 19:29:53 +00:00
parent 29c0ad98c0
commit a92684fb14
6 changed files with 36 additions and 2 deletions

View File

@ -1,4 +1,8 @@
---
# Yum configuration. Dict mapping Yum config option names to their values.
# yum_config:
# proxy: http://proxy.example.com
yum_config: {}
# Whether or not to use a local Yum mirror.
yum_use_local_mirror: false

View File

@ -1,5 +1,4 @@
---
- name: Replace | Disable YUM fastestmirror plugin (CentOS)
replace:
dest: /etc/yum/pluginconf.d/fastestmirror.conf

View File

@ -1,6 +1,15 @@
---
- block:
- include_tasks: redhat.yml
- name: Ensure yum.conf configuration exists
ini_file:
path: /etc/yum.conf
section: "main"
option: "{{ item.key }}"
value: "{{ item.value }}"
loop: "{{ query('dict', yum_config) }}"
become: true
- include_tasks: local-mirror.yml
when: yum_use_local_mirror | bool
- include_tasks: custom_repo.yml

View File

@ -176,6 +176,19 @@ Package Repositories
Kayobe supports configuration of package repositories via Yum, via variables in
``${KAYOBE_CONFIG_PATH}/yum.yml``.
Configuration of yum.conf
-------------------------
Global configuration of Yum is stored in ``/etc/yum.conf``, and options can be
set via the ``yum_config`` variable. Options are added to the ``[main]``
section of the file. For example, to configure Yum to use a proxy server:
.. code-block:: yaml
:caption: ``yum.yml``
yum_config:
proxy: https://proxy.example.com
CentOS and EPEL Mirrors
-----------------------

View File

@ -1,4 +1,8 @@
---
# Yum configuration. Dict mapping Yum config option names to their values.
# yum_config:
# proxy: http://proxy.example.com
#yum_config:
# Whether or not to use a local Yum mirror.
#yum_use_local_mirror: false

View File

@ -0,0 +1,5 @@
---
features:
- |
Adds support for configuration of options in ``/etc/yum.conf``, via the
``yum_config`` variable.