From 5b5323a518b02621615a95f635cebc1595ca2e2f Mon Sep 17 00:00:00 2001 From: Adrien Reslinger Date: Mon, 8 Jan 2024 19:10:02 +0100 Subject: [PATCH] Fix openvswitch deployment for RHEL --- tasks/RedHat.yml | 37 +++++++++++++++++++------------------ tasks/main.yml | 6 +++--- vars/RedHat.yml | 7 +++++++ 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/tasks/RedHat.yml b/tasks/RedHat.yml index 9732612..cc3bcd2 100644 --- a/tasks/RedHat.yml +++ b/tasks/RedHat.yml @@ -24,6 +24,7 @@ - etc/yum.repos.d/CentOS-Stream-NFV-OpenvSwitch.repo - etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-NFV when: + - ansible_distribution != "RedHat" # - ansible_distribution == "OracleLinux" - ansible_distribution != "CentOS" - ansible_distribution_major_version >= '8' @@ -33,22 +34,22 @@ state: present when: - ansible_distribution == "CentOS" -#- name: Enable a Fast Datapath RHSM repository -# community.general.rhsm_repository: -# name: "fast-datapath-for-rhel-8-{{ ansible_architecture }}-rpms" -# when: -# - ansible_distribution == "RedHat" -# - ansible_distribution_major_version == '8' -- name: Install OpenvSwitch - ansible.builtin.package: - name: - - openvswitch2.17 - - openvswitch2.17-ipsec - - openvswitch-selinux-extra-policy - - python3-openvswitch2.17 - - NetworkManager-ovs -# - network-scripts-openvswitch2.16 - state: present +- name: Enable a Fast Datapath RHSM repository + community.general.rhsm_repository: + name: "fast-datapath-for-rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}-rpms" + when: + - ansible_distribution == "RedHat" + - ansible_distribution_major_version >= '8' +#- name: Install OpenvSwitch +# ansible.builtin.package: +# name: +# - openvswitch3.2 +# - openvswitch3.2-ipsec +# - openvswitch-selinux-extra-policy +# - python3-openvswitch3.2 +# - NetworkManager-ovs +## - network-scripts-openvswitch2.16 +# state: present # update_cache: yes -# when: -# - (ansible_distribution == "OracleLinux") or (ansible_distribution == "CentOS") +## when: +## - (ansible_distribution == "OracleLinux") or (ansible_distribution == "CentOS") diff --git a/tasks/main.yml b/tasks/main.yml index 96ae4fc..4c113aa 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -5,13 +5,13 @@ - name: Include tasks for {{ ansible_os_family }} include_tasks: "{{ ansible_os_family }}.yml" -- name: install packages +- name: Install OpenVSwith packages package: name: "{{ openvswitch_packages }}" state: present update_cache: yes - when: - ansible_os_family != "RedHat" +# when: +# ansible_os_family != "RedHat" notify: Restart openvswitch - name: Enable openvswitch diff --git a/vars/RedHat.yml b/vars/RedHat.yml index e647d08..b810f9c 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -1,3 +1,10 @@ --- openvswitch_service: openvswitch +openvswitch_packages: + - openvswitch3.2 + - openvswitch3.2-ipsec + - openvswitch-selinux-extra-policy + - python3-openvswitch3.2 + - NetworkManager-ovs +# - network-scripts-openvswitch2.16