Fix openvswitch deployment for RHEL

This commit is contained in:
Adrien Reslinger 2024-01-08 19:10:02 +01:00
parent a3178a57e2
commit 5b5323a518
Signed by: adrien
GPG key ID: DA7B27055C66D6DE
3 changed files with 29 additions and 21 deletions

View file

@ -24,6 +24,7 @@
- etc/yum.repos.d/CentOS-Stream-NFV-OpenvSwitch.repo - etc/yum.repos.d/CentOS-Stream-NFV-OpenvSwitch.repo
- etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-NFV - etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-NFV
when: when:
- ansible_distribution != "RedHat"
# - ansible_distribution == "OracleLinux" # - ansible_distribution == "OracleLinux"
- ansible_distribution != "CentOS" - ansible_distribution != "CentOS"
- ansible_distribution_major_version >= '8' - ansible_distribution_major_version >= '8'
@ -33,22 +34,22 @@
state: present state: present
when: when:
- ansible_distribution == "CentOS" - ansible_distribution == "CentOS"
#- name: Enable a Fast Datapath RHSM repository - name: Enable a Fast Datapath RHSM repository
# community.general.rhsm_repository: community.general.rhsm_repository:
# name: "fast-datapath-for-rhel-8-{{ ansible_architecture }}-rpms" name: "fast-datapath-for-rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}-rpms"
# when: when:
# - ansible_distribution == "RedHat" - ansible_distribution == "RedHat"
# - ansible_distribution_major_version == '8' - ansible_distribution_major_version >= '8'
- name: Install OpenvSwitch #- name: Install OpenvSwitch
ansible.builtin.package: # ansible.builtin.package:
name: # name:
- openvswitch2.17 # - openvswitch3.2
- openvswitch2.17-ipsec # - openvswitch3.2-ipsec
- openvswitch-selinux-extra-policy # - openvswitch-selinux-extra-policy
- python3-openvswitch2.17 # - python3-openvswitch3.2
- NetworkManager-ovs # - NetworkManager-ovs
# - network-scripts-openvswitch2.16 ## - network-scripts-openvswitch2.16
state: present # state: present
# update_cache: yes # update_cache: yes
# when: ## when:
# - (ansible_distribution == "OracleLinux") or (ansible_distribution == "CentOS") ## - (ansible_distribution == "OracleLinux") or (ansible_distribution == "CentOS")

View file

@ -5,13 +5,13 @@
- name: Include tasks for {{ ansible_os_family }} - name: Include tasks for {{ ansible_os_family }}
include_tasks: "{{ ansible_os_family }}.yml" include_tasks: "{{ ansible_os_family }}.yml"
- name: install packages - name: Install OpenVSwith packages
package: package:
name: "{{ openvswitch_packages }}" name: "{{ openvswitch_packages }}"
state: present state: present
update_cache: yes update_cache: yes
when: # when:
ansible_os_family != "RedHat" # ansible_os_family != "RedHat"
notify: Restart openvswitch notify: Restart openvswitch
- name: Enable openvswitch - name: Enable openvswitch

View file

@ -1,3 +1,10 @@
--- ---
openvswitch_service: openvswitch openvswitch_service: openvswitch
openvswitch_packages:
- openvswitch3.2
- openvswitch3.2-ipsec
- openvswitch-selinux-extra-policy
- python3-openvswitch3.2
- NetworkManager-ovs
# - network-scripts-openvswitch2.16