From 68375810eea1b4e4bf4e6eee08aa3efc02df289f Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Wed, 12 Dec 2018 16:38:05 -0500 Subject: [PATCH] Vendor the RDO repository configuration for installing OVS Installing OVS on CentOS requires one RDO repository and the centos-release-openstack packages sets up two additional repos which aren't required. In addition, we removed the centos-release-openstack package but this did not remove the two extra repositories, causing them to "leak" into the jobs. This sets up the one repository we need and ensures it is removed after OVS is installed. Change-Id: Ida2299a4356282d23b79fac6753b6171211a7651 --- .../files/RPM-GPG-KEY-CentOS-SIG-Cloud | 20 ++++++++++ roles/multi-node-bridge/tasks/common.yaml | 38 ++++++++++++------- .../zuul-multi-node-bridge-ovs.repo.j2 | 11 ++++++ 3 files changed, 55 insertions(+), 14 deletions(-) create mode 100644 roles/multi-node-bridge/files/RPM-GPG-KEY-CentOS-SIG-Cloud create mode 100644 roles/multi-node-bridge/templates/zuul-multi-node-bridge-ovs.repo.j2 diff --git a/roles/multi-node-bridge/files/RPM-GPG-KEY-CentOS-SIG-Cloud b/roles/multi-node-bridge/files/RPM-GPG-KEY-CentOS-SIG-Cloud new file mode 100644 index 000000000..91f8e1c52 --- /dev/null +++ b/roles/multi-node-bridge/files/RPM-GPG-KEY-CentOS-SIG-Cloud @@ -0,0 +1,20 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2.0.22 (GNU/Linux) + +mQENBFVWcCcBCACfm3eQ0526/I0/p7HpR0NjK7K307XHhnbcbZv1sDUjQABDaqh0 +N4gnZcovf+3fj6pcdOmeOpGI0cKE7Fh68RbEIqyjB7l7+j1grjewR0oCFFZ38KGm +j+DWQrj1IJW7JU5fH/G0Cu66ix+dJPcuTB3PJTqXN3ce+4TuG09D+epgwfbHlqaT +pH2qHCu2uiGj/AaRSM/ZZzcInMaeleHSB+NChvaQ0W/m+kK5d/20d7sfkaTfI/pY +SrodCfVTYxfKAd0TLW03kimHs5/Rdz+iZWecVKv6aFxzaywbrOjmOsy2q0kEWIwX +MTZrq6cBRRuWyiXsI2zT2YHQ4UK44IxINiaJABEBAAG0WkNlbnRPUyBDbG91ZCBT +SUcgKGh0dHA6Ly93aWtpLmNlbnRvcy5vcmcvU3BlY2lhbEludGVyZXN0R3JvdXAv +Q2xvdWQpIDxzZWN1cml0eUBjZW50b3Mub3JnPokBOQQTAQIAIwUCVVZwJwIbAwcL +CQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEPm5/ud2RCnmATUH/3HDtWxpFkmy +FiA3VGkMt5dp3bgCRSd84X6Orfx1LARowpI4LomCGglGBGXVJePBacwcclorbLaz +uWrW/wU0efz0aDB5c4NPg/yXfNvujvlda8ADJwZXVBQphzvaIKwl4PqBsEnxC10I +93T/0iyphAhfMRJ5R8AbEHMj7uF+TWTX/JoyQagllMqWTwoP4DFRutPdOmmjwvSV +kWItH7hq6z9+M4dhlqeoOvPbL5oCxX7TVmLck02Q5gI4syULOa7sqntzUQKFkhWp +9U0+5KrBQBKezrurrrkq/WZR3WNE1KQfNQ77f7S2JcXJdOaKgJ7xe7Y2flPq98Aq +wKXK7l1c3dc= +=W6yF +-----END PGP PUBLIC KEY BLOCK----- diff --git a/roles/multi-node-bridge/tasks/common.yaml b/roles/multi-node-bridge/tasks/common.yaml index 86a64ee62..44a03a03d 100644 --- a/roles/multi-node-bridge/tasks/common.yaml +++ b/roles/multi-node-bridge/tasks/common.yaml @@ -5,17 +5,23 @@ - "{{ ansible_os_family }}.yaml" - "default.yaml" -# CentOS requires repositories provided by centos in order to install -# openvswitch, set them up. -- name: Enable centos-release-openstack-queens - become: yes - package: - name: centos-release-openstack-queens - state: installed - when: +# openvswitch for CentOS is available from the RDO repositories. +# We're setting it up manually to prevent centos-release-openstack or rdo-release +# from installing repositories we don't need. +- when: - ansible_os_family == "RedHat" - ansible_distribution != "Fedora" - register: centos_ovs + become: yes + block: + - name: Set up RDO GPG key + copy: + src: RPM-GPG-KEY-CentOS-SIG-Cloud + dest: /tmp/RPM-GPG-KEY-CentOS-SIG-Cloud + + - name: Set up RDO repository + template: + src: zuul-multi-node-bridge-ovs.repo.j2 + dest: /etc/yum.repos.d/zuul-multi-node-bridge-ovs.repo - name: Set package.use values for OVS on Gentoo become: yes @@ -42,13 +48,17 @@ state: started enabled: yes -# If we've installed repositories for openvswitch earlier, remove them -- name: Ensure centos-release-openstack-queens is removed +- name: Remove RDO repository files become: yes - package: - name: "centos-release-openstack-queens" + file: + path: "{{ item }}" state: absent - when: centos_ovs | changed + with_items: + - /tmp/RPM-GPG-KEY-CentOS-SIG-Cloud + - /etc/yum.repos.d/zuul-multi-node-bridge-ovs.repo + when: + - ansible_os_family == "RedHat" + - ansible_distribution != "Fedora" - name: Authorize the multi-node-bridge network become: yes diff --git a/roles/multi-node-bridge/templates/zuul-multi-node-bridge-ovs.repo.j2 b/roles/multi-node-bridge/templates/zuul-multi-node-bridge-ovs.repo.j2 new file mode 100644 index 000000000..ae6b0643a --- /dev/null +++ b/roles/multi-node-bridge/templates/zuul-multi-node-bridge-ovs.repo.j2 @@ -0,0 +1,11 @@ +# Vendored from rdo-release: https://github.com/rdo-infra/rdo-release +[centos-openstack-queens] +name=CentOS OpenStack Queens Repository +{% if zuul_site_mirror_fqdn is defined %} +baseurl=http://{{ zuul_site_mirror_fqdn }}/centos/7/cloud/$basearch/openstack-queens/ +{% else %} +baseurl=http://mirror.centos.org/centos/7/cloud/$basearch/openstack-queens/ +{% endif %} +gpgcheck=1 +enabled=1 +gpgkey=file:///tmp/RPM-GPG-KEY-CentOS-SIG-Cloud