From 5bb1c8c569a9928314ef9b094515abe46adcb957 Mon Sep 17 00:00:00 2001 From: Adrien Reslinger Date: Sat, 18 Sep 2021 00:25:07 +0200 Subject: [PATCH] Update for EL8 --- .../pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-NFV | 20 +++++++++++ .../yum.repos.d/CentOS-NFV-OpenvSwitch.repo | 36 +++++++++++++++++++ tasks/RedHat.yml | 33 ++++++++++++++--- tasks/main.yml | 7 ---- vars/RedHat.yml | 10 ------ vars/RedHat_8.yml | 14 -------- 6 files changed, 85 insertions(+), 35 deletions(-) create mode 100644 files/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-NFV create mode 100644 files/etc/yum.repos.d/CentOS-NFV-OpenvSwitch.repo delete mode 100644 vars/RedHat_8.yml diff --git a/files/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-NFV b/files/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-NFV new file mode 100644 index 0000000..23f8d49 --- /dev/null +++ b/files/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-NFV @@ -0,0 +1,20 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2.0.22 (GNU/Linux) + +mQENBFqMVyYBCACriP6iaXy1GtYgrueyz3U+GmNvNrnugEUAeWicotKvmlqjUKqs +s5N+Zr9yjAuwPjruywNVxuhRxTdyvU0PMMh7ZMkeWtJ26GWuCmN9Wf3rU5I2Eljh +nzulf06q8E1zYLtggHfk6FOP+lYloCOPZys6BCxeWA8MvRfhbspI0pIhnnIFwHYe +71K/ljyfoAsth/WC5kZnqj0LpJRVmp2kooS79LSC1DXTATaaU0RCSY5xINMTjrmD +6yA6GwRoAUu3y1IF02jI2Q3NoOht7GtYXDuAr+MaRJBI1oXr2uAbu4Frvcx3zHAy +CRbngZNnbh/kssAvAoEHev/qkhVhvbIwVuizABEBAAG0V0NlbnRPUyBORlYgU0lH +IChodHRwczovL3dpa2kuY2VudG9zLm9yZy9TcGVjaWFsSW50ZXJlc3RHcm91cC9O +RlYpIDxzZWN1cml0eUBjZW50b3Mub3JnPokBOQQTAQIAIwUCWoxXJgIbAwcLCQgH +AwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJECFGXiidKnanhrwH/2FOV18yEFpIIps9 +4GoAaLNtxdLEPbgLuKdu01x1ate2pv3yPQoewmI/AdxBItIA0uqeMX/XPGdBwvAD +1lPqpOtDBlaay12EeOTyhxKdTQdkW3Sb1Yhoj01qfNEEm3kaOiHDvIZHqxmj4OfP +K20hhI0pw2qm2JMsRtuLBgHo+rUP7gOHy7jbA1kvTc0lkpcQzTKgXM13L1l7tKXm +U8P7FKRKKG49IFQXtsbx1lW/vr2phzKVL93xQKeqEy5PauvZr+rIl8LNSVdoBEHc +y6f4nNlCyG0G2ZTe68vf4D9cFtITB/ZR6+/hp+2VT7ivT/hj+8721G900P3KjgA+ ++TXPsDw= +=B5Lp +-----END PGP PUBLIC KEY BLOCK----- diff --git a/files/etc/yum.repos.d/CentOS-NFV-OpenvSwitch.repo b/files/etc/yum.repos.d/CentOS-NFV-OpenvSwitch.repo new file mode 100644 index 0000000..fc4b32f --- /dev/null +++ b/files/etc/yum.repos.d/CentOS-NFV-OpenvSwitch.repo @@ -0,0 +1,36 @@ +# CentOS-NFV-OpenvSwitch.repo +# +# Please see http://wiki.centos.org/SpecialInterestGroup/NFV for more +# information + +[centos-nfv-openvswitch] +name=CentOS-$releasever - NFV OpenvSwitch +#baseurl=http://mirror.centos.org/centos/$nfvsigdist/nfv/$basearch/openvswitch-2/ +mirrorlist=http://mirrorlist.centos.org/?release=$nfvsigdist&arch=$basearch&repo=nfv-openvswitch-2 +gpgcheck=1 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-NFV +module_hotfixes=1 + +[centos-nfv-openvswitch-testing] +name=CentOS-$releasever - NFV OpenvSwitch Testing +baseurl=http://buildlogs.centos.org/centos/$nfvsigdist/nfv/$basearch/openvswitch-2/ +gpgcheck=0 +enabled=0 +module_hotfixes=1 + +[centos-nfv-openvswitch-debuginfo] +name=CentOS-$releasever - NFV OpenvSwitch - Debug +baseurl=http://debuginfo.centos.org/centos/$nfvsigdist/nfv/$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-NFV +module_hotfixes=1 + +[centos-nfv-openvswitch-source] +name=CentOS-$releasever - NFV OpenvSwitch - Source +baseurl=http://vault.centos.org/centos/$releasever/nfv/Source/openvswitch-2/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-NFV +module_hotfixes=1 diff --git a/tasks/RedHat.yml b/tasks/RedHat.yml index 2e50ea4..471cd27 100644 --- a/tasks/RedHat.yml +++ b/tasks/RedHat.yml @@ -1,6 +1,31 @@ --- -- name: Define OpenVSwitch repo packages - package: - name: "centos-release-ovirt42" +- name: Install CentOS NFV Openvswitch Repository + copy: + src: "{{ item }}" + dest: "/{{ item }}" + owner: root + group: root + mode: 0644 + with_items: + - etc/yum.repos.d/CentOS-NFV-OpenvSwitch.repo + - etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-NFV + when: + - ansible_distribution == "OracleLinux" +- name: Install CentOS NFV Openvswitch Repository RPM + ansible.builtin.package: + name: centos-release-nfv-openvswitch state: present - update_cache: yes + when: + - ansible_distribution == "CentOS" +- name: Install OpenvSwitch + ansible.builtin.package: + name: + - openvswitch2.13 + - openvswitch2.13-ipsec + - openvswitch-selinux-extra-policy + - python3-openvswitch2.13 + - NetworkManager-ovs + state: present +# update_cache: yes + when: + - (ansible_distribution == "OracleLinux") or (ansible_distribution == "CentOS") diff --git a/tasks/main.yml b/tasks/main.yml index bfc0b69..87e588e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,13 +2,6 @@ - name: Include vars for {{ ansible_os_family }} include_vars: "{{ ansible_os_family }}.yml" -- name: remove old packages - package: - name: "{{ openvswitch_remove_packages }}" - state: absent - update_cache: yes - notify: Restart openvswitch - - name: Include tasks for {{ ansible_os_family }} include_tasks: "{{ ansible_os_family }}.yml" diff --git a/vars/RedHat.yml b/vars/RedHat.yml index 8f6c1f8..e647d08 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -1,13 +1,3 @@ --- -openvswitch_remove_packages: - - centos-release-ovirt41 -# - openvswitch-selinux-policy -openvswitch_packages: - - openvswitch - - openvswitch-ovn-central - - openvswitch-ovn-docker - - openvswitch-ovn-host - - openvswitch-ovn-vtep -# - python2-openvswitch # Seem not needed openvswitch_service: openvswitch diff --git a/vars/RedHat_8.yml b/vars/RedHat_8.yml deleted file mode 100644 index 9ca23ed..0000000 --- a/vars/RedHat_8.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -openvswitch_remove_packages: - - centos-release-ovirt41 -# - openvswitch-selinux-policy -openvswitch_packages: - - NetworkManager-ovs - - openvswitch - - openvswitch-ovn-central - - openvswitch-ovn-docker - - openvswitch-ovn-host - - openvswitch-ovn-vtep -# - python2-openvswitch # Seem not needed -openvswitch_service: openvswitch -