Set higher priority for COPR repo

This patch sets the priority for the COPR repository on CentOS 7
(which we use to install LXC) to a higher priority than the default.
This ensures we always get our LXC packages from the COPR repo.

Change-Id: I07d127cb5fba8f4e30633da88eaecf9228eb350a
This commit is contained in:
Major Hayden 2017-03-07 10:43:03 -06:00
parent 7a92a1ee69
commit d902d53b36
No known key found for this signature in database
GPG Key ID: 737051E0C1011FB1
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,6 @@
---
features:
- |
The COPR repository for installing LXC on CentOS 7 is now set to a higher
priority than the default to ensure that LXC packages always come from the
COPR repository.

View File

@ -22,7 +22,24 @@
gpgcheck: yes
gpgkey: "{{ lxc_centos_package_key }}"
repo_gpgcheck: no
priority: 50
state: present
register: copr_repository_deploy
# NOTE: Existing CentOS environments may not have the COPR repo priority set
# higher than the default. The following task ensures that existing
# deployments have their priority adjusted for the COPR repository.
# TODO(mhayden): The ini_file module is required here since the yum_repository
# module can only do add/remove operations, not edits.
# Ansible bug: https://github.com/ansible/ansible/issues/22362
- name: Ensure COPR repository priority is set
ini_file:
dest: /etc/yum.repos.d/thm-lxc2.0.repo
section: thm-lxc2.0
option: priority
value: 50
when:
- not copr_repository_deploy | changed
- name: Add GPG key for COPR LXC repo
rpm_key: