From 492940be7b2a89b18975afa56e04a8beb4019ae2 Mon Sep 17 00:00:00 2001
From: Viktor Michalek <viktor.michalek@ultimum.io>
Date: Tue, 1 Oct 2019 14:16:43 +0200
Subject: [PATCH] Openvswitch: some ovs tools require ovs daemons pidfiles

Change-Id: I4050c243f05571bbebab07b08c101e61879cda67
Closes-Bug: 1848363
---
 ansible/roles/openvswitch/templates/start-ovs.j2          | 2 +-
 ansible/roles/openvswitch/templates/start-ovsdb-server.j2 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ansible/roles/openvswitch/templates/start-ovs.j2 b/ansible/roles/openvswitch/templates/start-ovs.j2
index fe5f34f28d..08ed040e24 100644
--- a/ansible/roles/openvswitch/templates/start-ovs.j2
+++ b/ansible/roles/openvswitch/templates/start-ovs.j2
@@ -8,4 +8,4 @@
 /usr/bin/ovs-vsctl --no-wait -- set Open_vSwitch . external_ids:odl_os_hostconfig_config_odl_l2='{"supported_vnic_types": [{"vnic_type": "normal", "vif_type": "ovs", "vif_details": {} }], "allowed_network_types": [{{ opendaylight_allowed_network_types }}], "datapath_types": ["netdev", "system"], "bridge_mappings": {"physnet1":"{{ neutron_bridge_name }}"} }'
 /usr/bin/ovs-vsctl --no-wait -- set Open_vSwitch . external_ids:odl_os_hostconfig_hostid="{{ hostvars[inventory_hostname]['ansible_hostname'] }}"
 {% endif %}
-/usr/sbin/ovs-vswitchd unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file=/var/log/kolla/openvswitch/ovs-vswitchd.log
+/usr/sbin/ovs-vswitchd unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file=/var/log/kolla/openvswitch/ovs-vswitchd.log --pidfile
diff --git a/ansible/roles/openvswitch/templates/start-ovsdb-server.j2 b/ansible/roles/openvswitch/templates/start-ovsdb-server.j2
index 579e0bb225..d67f33059f 100644
--- a/ansible/roles/openvswitch/templates/start-ovsdb-server.j2
+++ b/ansible/roles/openvswitch/templates/start-ovsdb-server.j2
@@ -35,5 +35,5 @@ if [ ! -e $ovs_bridge  ] && [ ! -e $ovs_ext_intf  ]; then
     /usr/sbin/ovsdb-server /var/lib/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/var/run/openvswitch/db.sock --remote=ptcp:6640 --log-file=/var/log/kolla/openvswitch/ovsdb-server.log
 else
 # NOTE: (sbezverk) This part is executed only by kolla-ansible deployment.
-    /usr/sbin/ovsdb-server /var/lib/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/run/openvswitch/db.sock --remote=ptcp:{{ ovsdb_port }}:$ovsdb_ip --remote=db:Open_vSwitch,Open_vSwitch,manager_options --log-file=/var/log/kolla/openvswitch/ovsdb-server.log
+    /usr/sbin/ovsdb-server /var/lib/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/run/openvswitch/db.sock --remote=ptcp:{{ ovsdb_port }}:$ovsdb_ip --remote=db:Open_vSwitch,Open_vSwitch,manager_options --log-file=/var/log/kolla/openvswitch/ovsdb-server.log --pidfile
 fi