From 4e6188b4c05da7a9cf878421c109f75068423cae Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Tue, 7 Mar 2017 08:25:31 -0600 Subject: [PATCH] Use yum priorities for RDO This patch installs the yum priorities plugin and ensures that RDO has a higher priority than EPEL. This ensures that the packages from the RDO repository are preferred over those from EPEL. Related-bug: 1670012 Change-Id: Ib31e8379f98c91707e9e09207b873f3f597679e6 --- tasks/pre_install_apt.yml | 4 ++-- tasks/pre_install_yum.yml | 20 +++++++++++++++++++- vars/redhat-7.yml | 1 + 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/tasks/pre_install_apt.yml b/tasks/pre_install_apt.yml index 627f24b..a3e4f6e 100644 --- a/tasks/pre_install_apt.yml +++ b/tasks/pre_install_apt.yml @@ -19,7 +19,7 @@ cache_valid_time: "{{ cache_timeout }}" # Under Ubuntu, this will only add the key -- name: Install external repo key with package +- name: Install UCA repository key apt: name: "{{ pip_install_external_repo_key_package }}" state: "{{ pip_install_external_repo_key_package_state | default('present') }}" @@ -28,7 +28,7 @@ tags: - add-repo-keys -- name: Install repo for distro binaries +- name: Install UCA repository apt_repository: repo: "{{ uca_repo }}" state: present diff --git a/tasks/pre_install_yum.yml b/tasks/pre_install_yum.yml index d6bbc0b..47fb34a 100644 --- a/tasks/pre_install_yum.yml +++ b/tasks/pre_install_yum.yml @@ -14,7 +14,7 @@ # limitations under the License. # Under CentOS, this will add the repo and its key to the keyring -- name: Install external repo key with package +- name: Install RDO repository and key yum: name: "{{ pip_install_external_repo_key_package }}" state: "{{ pip_install_external_repo_key_package_state | default('present') }}" @@ -23,6 +23,24 @@ tags: - add-repo-keys +# NOTE: All yum repositories are priority 99 (lowest possible) by default. +# EPEL and RDO have packages that conflict (especially with RabbitMQ's +# Erlang dependencies). This task ensures that RDO is always preferred +# over EPEL when both are configured. +# TODO(mhayden): If the yum_repository module is improved to allow for edits to +# existing repository files, this task should be updated to use +# yum_repository instead of ini_file. +# Ansible bug: https://github.com/ansible/ansible/issues/22362 +- name: Increase priority for RDO repository + ini_file: + dest: "{{ item.path }}" + section: "{{ item.section }}" + option: priority + value: 50 + with_items: + - { path: "/etc/yum.repos.d/rdo-release.repo", section: "openstack-ocata" } + - { path: "/etc/yum.repos.d/rdo-qemu-ev.repo", section: "rdo-qemu-ev"} + - name: Install external repo key manually rpm_key: key: "{{ item.key }}" diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index 7e49357..06284ef 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -22,6 +22,7 @@ pip_install_distro_build_packages: - python-devel - python-pyasn1 - python2-pyOpenSSL + - yum-plugin-priorities pip_required_pip_packages: - ndg-httpsclient # SSL SNI support