Ian Wienand | 5cdee8d | 2015-10-19 14:17:18 +1100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 3 | # Neutron firewall plugin |
| 4 | # --------------------------- |
| 5 | |
| 6 | # Save trace setting |
Ian Wienand | 523f488 | 2015-10-13 11:03:03 +1100 | [diff] [blame] | 7 | _XTRACE_NEUTRON_FIREWALL=$(set +o | grep xtrace) |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 8 | set +o xtrace |
| 9 | |
Jerry Zhao | 8eab6ad | 2016-02-01 18:22:21 -0800 | [diff] [blame] | 10 | FWAAS_PLUGIN=${FWAAS_PLUGIN:-neutron_fwaas.services.firewall.fwaas_plugin.FirewallPlugin} |
| 11 | FWAAS_DRIVER=${FWAAS_DRIVER:-neutron_fwaas.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver} |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 12 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 13 | function neutron_fwaas_configure_common { |
Isaku Yamahata | 9e136b4 | 2013-12-16 15:52:03 +0900 | [diff] [blame] | 14 | _neutron_service_plugin_class_add $FWAAS_PLUGIN |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 15 | } |
| 16 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 17 | function neutron_fwaas_configure_driver { |
Martin Hickey | 7b7101f | 2015-12-01 22:17:42 +0000 | [diff] [blame] | 18 | # Uses oslo config generator to generate FWaaS sample configuration files |
| 19 | (cd $NEUTRON_FWAAS_DIR && exec ./tools/generate_config_file_samples.sh) |
| 20 | |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 21 | FWAAS_DRIVER_CONF_FILENAME=/etc/neutron/fwaas_driver.ini |
Martin Hickey | 7b7101f | 2015-12-01 22:17:42 +0000 | [diff] [blame] | 22 | cp $NEUTRON_FWAAS_DIR/etc/fwaas_driver.ini.sample $FWAAS_DRIVER_CONF_FILENAME |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 23 | |
| 24 | iniset_multiline $FWAAS_DRIVER_CONF_FILENAME fwaas enabled True |
Jerry Zhao | 8eab6ad | 2016-02-01 18:22:21 -0800 | [diff] [blame] | 25 | iniset_multiline $FWAAS_DRIVER_CONF_FILENAME fwaas driver "$FWAAS_DRIVER" |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 26 | } |
| 27 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 28 | function neutron_fwaas_stop { |
Akihiro Motoki | edddb1f | 2013-12-09 20:21:06 +0900 | [diff] [blame] | 29 | : |
| 30 | } |
| 31 | |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 32 | # Restore xtrace |
Ian Wienand | 523f488 | 2015-10-13 11:03:03 +1100 | [diff] [blame] | 33 | $_XTRACE_NEUTRON_FIREWALL |