From 921c98f67bb6cf61fbb7d1393245ab9e4aac8bdb Mon Sep 17 00:00:00 2001 From: Kourosh Vivan Date: Thu, 17 Oct 2019 16:48:16 +0200 Subject: [PATCH] Centos EPEL options default to global variable Repository variables lxc_centos_epel_mirror and lxc_centos_epel_key will default to centos_epel_mirror and centos_epel_key Change-Id: Icf84a0a55654fa890947bae5b608870eddad7324 --- defaults/main.yml | 10 ++++------ .../notes/centos-private-epel-3fe4c9ff68ec3a18.yaml | 5 ++--- tasks/lxc_install_yum.yml | 4 ++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 43ff156a..51891b44 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -91,12 +91,6 @@ lxc_container_cache_path: "/var/cache/lxc/download" # copy_from_host: [] # List of files to copy into the container lxc_cache_map: "{{ _lxc_cache_map }}" - -## If you want to use a custom epel repo -# lxc_centos_epel_mirror: http://mirror.myconpany/epel/ -# lxc_centos_epel_gpg_key: http://mirror.myconpany/epel-key/RPM-GPG-KEY-EPEL-7 - - # When using a base container to snapshot from for the overlayfs or LVM # copy-on-write backing stored, the base container can be set. lxc_container_base_name: "{{ lxc_cache_map.distro }}-{{ lxc_cache_map.release }}-{{ lxc_cache_map.arch }}" @@ -250,6 +244,10 @@ lxc_cache_download_template_options: >- # Locales to populate in the LXC base cache lxc_cache_locales: "{{ _lxc_cache_locales | default(['en_US.UTF-8']) }}" +# Centos EPEL repository options +lxc_centos_epel_mirror: "{{ centos_epel_mirror | default('http://download.fedoraproject.org/pub/epel') }}" +lxc_centos_epel_key: "{{ centos_epel_key | default('http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7') }}" + # LXC must be installed from a COPR repository on CentOS 7 since the version # provided in EPEL is much too old (1.x). lxc_centos_package_baseurl: https://copr-be.cloud.fedoraproject.org/results/thm/lxc2.0/epel-7-x86_64/ diff --git a/releasenotes/notes/centos-private-epel-3fe4c9ff68ec3a18.yaml b/releasenotes/notes/centos-private-epel-3fe4c9ff68ec3a18.yaml index 70a0a8a6..c0da458a 100644 --- a/releasenotes/notes/centos-private-epel-3fe4c9ff68ec3a18.yaml +++ b/releasenotes/notes/centos-private-epel-3fe4c9ff68ec3a18.yaml @@ -1,6 +1,5 @@ --- features: - You can set a private repository for epel, you must use - ``lxc_centos_epel_mirror`` for the repo URL and if you need to get the GPG - key from intranet or a mirror use ``lxc_centos_epel_gpg_key`` for gpg key - location. + ``lxc_centos_epel_mirror`` for the repo URL and if you need to get the GPG key + from intranet or a mirror use ``lxc_centos_epel_key`` for gpg key location. diff --git a/tasks/lxc_install_yum.yml b/tasks/lxc_install_yum.yml index d482debf..43e6575f 100644 --- a/tasks/lxc_install_yum.yml +++ b/tasks/lxc_install_yum.yml @@ -36,7 +36,7 @@ - name: Install EPEL gpg keys rpm_key: - key: "{{ lxc_centos_epel_gpg_key | default ('http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7') }}" + key: "{{ lxc_centos_epel_key }}" state: present register: _add_yum_keys until: _add_yum_keys is success @@ -46,7 +46,7 @@ - name: Install the EPEL repository yum_repository: name: epel-lxc_hosts - baseurl: "{{ (lxc_centos_epel_mirror | default ('http://download.fedoraproject.org/pub/epel')) ~ '/' ~ ansible_distribution_major_version ~ '/' ~ ansible_architecture }}" + baseurl: "{{ lxc_centos_epel_mirror ~ '/' ~ ansible_distribution_major_version ~ '/' ~ ansible_architecture }}" description: 'Extra Packages for Enterprise Linux 7 - $basearch' gpgcheck: yes enabled: yes