Merge "Add cleanup service for neutron ovs bridges"

This commit is contained in:
Zuul 2018-08-14 02:43:27 +00:00 committed by Gerrit Code Review
commit dce59cce91
4 changed files with 58 additions and 1 deletions

View File

@ -180,7 +180,27 @@ outputs:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
metadata_settings:
get_attr: [NeutronOvsAgentBase, role_data, metadata_settings]
host_prep_tasks: {get_attr: [NeutronLogging, host_prep_tasks]}
host_prep_tasks:
list_concat:
- {get_attr: [NeutronLogging, host_prep_tasks]}
-
- block:
- name: Copy in cleanup script
copy:
content: {get_file: ./neutron/neutron-cleanup}
dest: '/usr/libexec/neutron-cleanup'
force: yes
mode: '0755'
- name: Copy in cleanup service
copy:
content: {get_file: ./neutron/neutron-cleanup.service}
dest: '/usr/lib/systemd/system/neutron-cleanup.service'
force: yes
- name: Enabling the cleanup service
service:
name: neutron-cleanup
enabled: yes
upgrade_tasks:
list_concat:
- get_attr: [NeutronOvsAgentBase, role_data, ovs_upgrade_tasks]

View File

@ -0,0 +1,21 @@
#!/bin/bash
# Cleanup neutron OVS bridges. To be called on startup to avoid
# "difficult-to-debug" issues with partially configured resources.
NEUTRON_OVS_CONF=/var/lib/config-data/puppet-generated/neutron/etc/neutron/plugins/ml2/openvswitch_agent.ini
if [ -e ${NEUTRON_OVS_CONF} ];
then
INT_BRIDGE=`crudini --get ${NEUTRON_OVS_CONF} ovs integration_bridge`
TUN_BRIDGE=`crudini --get ${NEUTRON_OVS_CONF} ovs tunnel_bridge`
fi
for br in ${INT_BRIDGE:-"br-int"} ${TUN_BRIDGE:-"br-tun"};
do
ovs-vsctl --if-exists del-br $br
done
# Clean up trunk port bridges
for br in $(ovs-vsctl list-br | egrep 'tbr-[0-9a-f\-]+'); do
ovs-vsctl --if-exists del-br $br
done

View File

@ -0,0 +1,12 @@
[Unit]
Description=Neutron cleanup on startup
After=openvswitch.service network.target
Before=docker.service
RefuseManualStop=yes
[Service]
Type=oneshot
ExecStart=/usr/libexec/neutron-cleanup
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,4 @@
---
features:
- |
Add cleanup services for neutron bridges that work with container based deployments.