Do not install Open vSwitch

Open vSwitch packages are no longer present in the default, or EPEL
repoistories. This means there is no clean way to install Open vSwitch
on CentOS. Instead, we should leave it up the user to decide how to
install it.

Change-Id: Ie56296230c9840e542ac70d96dc68c285d198ad6
This commit is contained in:
Will Szumski 2019-10-18 10:32:02 +01:00
parent f92968386b
commit 9c126332be
9 changed files with 83 additions and 35 deletions

View File

@ -34,24 +34,12 @@
failed_when: false failed_when: false
changed_when: false changed_when: false
- block: - name: Fail when Open vSwitch is not installed
- name: Ensure Open vSwitch package is installed fail:
package: msg: >-
name: "{{ tenks_openvswitch_pkg_name }}" Tenks requires openvswitch to be installed and running. Please install
register: result openvswitch. If it is installed, please report this as a bug.
until: result is success # Assume a non-zero return code means that openvswitch is not installed.
retries: 3
become: true
- name: Ensure Open vSwitch is started and enabled
service:
name: "{{ tenks_openvswitch_service_name }}"
state: started
enabled: true
become: true
# Assume a non-zero return code means the command does not exist. Do this
# check to avoid installing Open vSwitch system-wide if the command already
# exists as a link to a containerised version of OVS.
when: ovs_vsctl_check.rc != 0 when: ovs_vsctl_check.rc != 0
- name: Configure physical networks - name: Configure physical networks

View File

@ -2,10 +2,3 @@
# path to `ip` from the `iproute2` package # path to `ip` from the `iproute2` package
tenks_ip_path: /sbin/ip tenks_ip_path: /sbin/ip
# package that provides the Open vSwitch daemon and userspace
# utilities
tenks_openvswitch_pkg_name: openvswitch-switch
# service name of Open vSwitch daemon (as passed the Ansible service module)
tenks_openvswitch_service_name: openvswitch-switch

View File

@ -2,10 +2,3 @@
# path to `ip` from the `iproute2` package # path to `ip` from the `iproute2` package
tenks_ip_path: /usr/sbin/ip tenks_ip_path: /usr/sbin/ip
# package that provides the Open vSwitch daemon and userspace
# utilities
tenks_openvswitch_pkg_name: openvswitch
# service name of Open vSwitch daemon (as passed the Ansible service module)
tenks_openvswitch_service_name: openvswitch

View File

@ -39,6 +39,10 @@ installed with a command such as::
$ yum install --assumeyes python-virtualenv git $ yum install --assumeyes python-virtualenv git
Open vSwitch must be installed and running. Please see the
`Open vSwitch docs <https://docs.openvswitch.org/en/latest/intro/install/>`_
for more details.
Tenks Installation Tenks Installation
------------------ ------------------

49
playbooks/openvswitch.yml Normal file
View File

@ -0,0 +1,49 @@
---
- hosts: hypervisors
vars:
ansible_become: true
tasks:
# Workaround for:
# http://mirror.ord.rax.opendev.org/epel/7/SRPMS/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
# See: https://zuul.opendev.org/t/openstack/build/1fa5b2f895c54e7a81a064a2fff5f838/log/centos-7/ansible/tenks-deploy#501
- block:
- name: Install epel release
package:
name: epel-release
- name: Switch the broken mirror
ini_file:
path: /etc/yum.repos.d/epel.repo
section: epel-source
option: baseurl
value: http://download.fedoraproject.org/pub/epel/$releasever/SRPMS/
- name: Make sure metalink does not exist
ini_file:
path: /etc/yum.repos.d/epel.repo
section: epel-source
option: metalink
state: absent
- name: Install Open vSwitch
include_role:
name: fkautz.openvswitch-install
when: ansible_os_family == "RedHat"
- block:
- name: Install packages
package:
name: "{{ item }}"
register: result
until: result is success
retries: 3
with_items:
- openvswitch-switch
- openvswitch-common
- name: Start openvswitch service
service:
name: openvswitch-switch
state: started
when: ansible_os_family == "Debian"

View File

@ -38,9 +38,10 @@
-p {{ tenks_src_dir }}/ansible/roles -p {{ tenks_src_dir }}/ansible/roles
chdir: "{{ tenks_src_dir }}" chdir: "{{ tenks_src_dir }}"
- name: Override Galaxy dependencies with equivalent modules from the zuul checkout - name: Install dependencies for CI
# We override so that as we add more dependenices we won't have to keep two files in # We install roles specifc to CI over the existing ones. This means that we
# sync # don't have to keep the two requirements files in sync, as we just override
# some of them.
vars: vars:
ansible_galaxy_bin: "{{ tenks_venv }}/bin/ansible-galaxy" ansible_galaxy_bin: "{{ tenks_venv }}/bin/ansible-galaxy"
command: command:

View File

@ -6,6 +6,17 @@
- name: Include common variables - name: Include common variables
include_vars: common.yml include_vars: common.yml
- name: Install Open vSwitch
shell:
cmd: >-
{{ ansible_playbook_bin }} -vvv
--inventory ansible/inventory
--extra-vars=@{{ tenks_overrides_path }}
playbooks/openvswitch.yml > {{ logs_dir }}/ansible/tenks-deploy
chdir: "{{ tenks_src_dir }}"
environment:
ANSIBLE_ROLES_PATH: "{{ tenks_src_dir }}/ansible/roles"
- name: Deploy tenks cluster - name: Deploy tenks cluster
shell: shell:
cmd: >- cmd: >-

View File

@ -8,3 +8,7 @@
- src: git+{{ stackhpc_libvirt_vm_src_dir }}/.git - src: git+{{ stackhpc_libvirt_vm_src_dir }}/.git
name: stackhpc.libvirt-vm name: stackhpc.libvirt-vm
# Roles for CI only
- src: https://github.com/stackhpc/ansible-roles-openvswitch-install
name: fkautz.openvswitch-install

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
Tenks no longer installs Open vSwitch. Please use your preferred method to
install Open vSwitch prior to running Tenks.