From 97d409a911b5aaaa1bcc2c069da2d3c277236b47 Mon Sep 17 00:00:00 2001 From: Satish Patel Date: Mon, 9 Aug 2021 20:09:26 +0000 Subject: [PATCH] Add support of OVN for CentOS-8-Stream This patch will adjust some variable for C8-Stream job to fix OVN deployment for CentOS-8-Stream. Renamed ovn-central with ovn-northd for more generic name. Change-Id: Ifdb773f9f539469e21d37075f6b88259eb1ffa3e --- handlers/main.yml | 8 +++---- tasks/providers/ovn_cluster_setup.yml | 21 ++++++++----------- .../{ovn-central.j2 => ovn-northd-opts.j2} | 2 +- vars/debian.yml | 4 ++++ vars/redhat.yml | 4 ++++ 5 files changed, 22 insertions(+), 17 deletions(-) rename templates/{ovn-central.j2 => ovn-northd-opts.j2} (95%) diff --git a/handlers/main.yml b/handlers/main.yml index d06f814a..83dc6e2c 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -129,13 +129,13 @@ - "Restart neutron services" - "venv changed" -- name: start ovn-central service +- name: start ovn service service: - name: ovn-central + name: "{{ neutron_ovn_northd_service_name }}" state: started # (NOTE) Restarting twice to cleanup some pid. -- name: restart ovn-central service +- name: restart ovn service service: - name: ovn-central + name: "{{ neutron_ovn_northd_service_name }}" state: restarted diff --git a/tasks/providers/ovn_cluster_setup.yml b/tasks/providers/ovn_cluster_setup.yml index 92cb186a..61c9d012 100644 --- a/tasks/providers/ovn_cluster_setup.yml +++ b/tasks/providers/ovn_cluster_setup.yml @@ -31,11 +31,8 @@ block: - name: Stop ovn services service: - name: "{{ item }}" + name: "{{ neutron_ovn_northd_service_name }}" state: stopped - with_items: - - ovn-northd - - ovn-central - name: Clean up ovn db directory file: @@ -64,23 +61,23 @@ # This play only run first time to build cluster using primary node. - name: Setup ovn cluster using primary node. template: - src: ovn-central.j2 - dest: "/etc/default/ovn-central" + src: ovn-northd-opts.j2 + dest: "{{ neutron_ovn_northd_opts_file }}" when: - "inventory_hostname == neutron_ovn_primary_cluster_node" - _check_cluster_db.rc != 0 - not leader_node notify: - - start ovn-central service - - restart ovn-central service + - start ovn service + - restart ovn service # This play will add nodes in existing cluster using leader_node var. - name: Join new nodes to ovn cluster using leader node template: - src: ovn-central.j2 - dest: "/etc/default/ovn-central" + src: ovn-northd-opts.j2 + dest: "{{ neutron_ovn_northd_opts_file }}" when: - _check_cluster_db.rc != 0 notify: - - start ovn-central service - - restart ovn-central service + - start ovn service + - restart ovn service diff --git a/templates/ovn-central.j2 b/templates/ovn-northd-opts.j2 similarity index 95% rename from templates/ovn-central.j2 rename to templates/ovn-northd-opts.j2 index ef13b0bc..c83bb7a5 100644 --- a/templates/ovn-central.j2 +++ b/templates/ovn-northd-opts.j2 @@ -1,7 +1,7 @@ # {{ ansible_managed }} # OVN cluster parameters -OVN_CTL_OPTS=" \ +{{ neutron_ovn_northd_opts }}=" \ --db-nb-create-insecure-remote=yes \ --db-sb-create-insecure-remote=yes \ --db-nb-addr={{ ansible_host }} \ diff --git a/vars/debian.yml b/vars/debian.yml index 8cfdad4a..2a46029a 100644 --- a/vars/debian.yml +++ b/vars/debian.yml @@ -25,6 +25,10 @@ neutron_ovn_controller_service_name: ovn-host neutron_ovs_socket_path: "/var/run/openvswitch" +neutron_ovn_northd_opts: "OVN_CTL_OPTS" + +neutron_ovn_northd_opts_file: "/etc/default/ovn-central" + neutron_ovs_dpdk_required_packages: - openvswitch-common - openvswitch-switch-dpdk diff --git a/vars/redhat.yml b/vars/redhat.yml index c27e95ef..0da8be38 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -32,6 +32,10 @@ neutron_ovn_controller_service_name: ovn-controller neutron_ovs_socket_path: "/var/run/openvswitch" +neutron_ovn_northd_opts: "OVN_NORTHD_OPTS" + +neutron_ovn_northd_opts_file: "/etc/sysconfig/ovn-northd" + neutron_distro_packages: - conntrack-tools - dnsmasq