blob: 40968fa04c94fc527fb96028adb014bed6a20fd0 [file] [log] [blame]
Ian Wienand5cdee8d2015-10-19 14:17:18 +11001#!/bin/bash
2
Ravi Chunduru95c93e22013-07-16 04:18:47 -07003# Neutron firewall plugin
4# ---------------------------
5
6# Save trace setting
Ian Wienand523f4882015-10-13 11:03:03 +11007_XTRACE_NEUTRON_FIREWALL=$(set +o | grep xtrace)
Ravi Chunduru95c93e22013-07-16 04:18:47 -07008set +o xtrace
9
Jerry Zhao8eab6ad2016-02-01 18:22:21 -080010FWAAS_PLUGIN=${FWAAS_PLUGIN:-neutron_fwaas.services.firewall.fwaas_plugin.FirewallPlugin}
11FWAAS_DRIVER=${FWAAS_DRIVER:-neutron_fwaas.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver}
Ravi Chunduru95c93e22013-07-16 04:18:47 -070012
Ian Wienandaee18c72014-02-21 15:35:08 +110013function neutron_fwaas_configure_common {
Isaku Yamahata9e136b42013-12-16 15:52:03 +090014 _neutron_service_plugin_class_add $FWAAS_PLUGIN
Ravi Chunduru95c93e22013-07-16 04:18:47 -070015}
16
Ian Wienandaee18c72014-02-21 15:35:08 +110017function neutron_fwaas_configure_driver {
Martin Hickey7b7101f2015-12-01 22:17:42 +000018 # Uses oslo config generator to generate FWaaS sample configuration files
19 (cd $NEUTRON_FWAAS_DIR && exec ./tools/generate_config_file_samples.sh)
20
Ravi Chunduru95c93e22013-07-16 04:18:47 -070021 FWAAS_DRIVER_CONF_FILENAME=/etc/neutron/fwaas_driver.ini
Martin Hickey7b7101f2015-12-01 22:17:42 +000022 cp $NEUTRON_FWAAS_DIR/etc/fwaas_driver.ini.sample $FWAAS_DRIVER_CONF_FILENAME
Ravi Chunduru95c93e22013-07-16 04:18:47 -070023
24 iniset_multiline $FWAAS_DRIVER_CONF_FILENAME fwaas enabled True
Jerry Zhao8eab6ad2016-02-01 18:22:21 -080025 iniset_multiline $FWAAS_DRIVER_CONF_FILENAME fwaas driver "$FWAAS_DRIVER"
Ravi Chunduru95c93e22013-07-16 04:18:47 -070026}
27
Ian Wienandaee18c72014-02-21 15:35:08 +110028function neutron_fwaas_stop {
Akihiro Motokiedddb1f2013-12-09 20:21:06 +090029 :
30}
31
Ravi Chunduru95c93e22013-07-16 04:18:47 -070032# Restore xtrace
Ian Wienand523f4882015-10-13 11:03:03 +110033$_XTRACE_NEUTRON_FIREWALL