blob: 7e80b5b5f852c2100261fd3270ff0bed0c609522 [file] [log] [blame]
Nachi Ueno69b3ff62013-06-07 10:28:33 -07001# Neutron VPN plugin
2# ---------------------------
3
4# Save trace setting
Dean Troyere3a91602014-03-28 12:40:56 -05005VPN_XTRACE=$(set +o | grep xtrace)
Nachi Ueno69b3ff62013-06-07 10:28:33 -07006set +o xtrace
7
8
Nachi Ueno584750f2013-07-15 18:22:21 -07009AGENT_VPN_BINARY="$NEUTRON_BIN_DIR/neutron-vpn-agent"
Kyle Mestery20b839f2014-12-08 06:17:27 +000010VPN_PLUGIN=${VPN_PLUGIN:-"neutron_vpnaas.services.vpn.plugin.VPNDriverPlugin"}
Nachi Ueno1e3d3182013-08-15 18:15:31 -070011IPSEC_PACKAGE=${IPSEC_PACKAGE:-"openswan"}
Nachi Ueno69b3ff62013-06-07 10:28:33 -070012
Ian Wienandaee18c72014-02-21 15:35:08 +110013function neutron_vpn_install_agent_packages {
Nachi Ueno1e3d3182013-08-15 18:15:31 -070014 install_package $IPSEC_PACKAGE
Nachi Ueno69b3ff62013-06-07 10:28:33 -070015}
16
Ian Wienandaee18c72014-02-21 15:35:08 +110017function neutron_vpn_configure_common {
Isaku Yamahata9e136b42013-12-16 15:52:03 +090018 _neutron_service_plugin_class_add $VPN_PLUGIN
Ihar Hrachyshka5893cc72014-12-22 11:49:42 +010019 _neutron_deploy_rootwrap_filters $NEUTRON_VPNAAS_DIR
Nachi Ueno69b3ff62013-06-07 10:28:33 -070020}
21
Ian Wienandaee18c72014-02-21 15:35:08 +110022function neutron_vpn_stop {
Akihiro Motokiedddb1f2013-12-09 20:21:06 +090023 local ipsec_data_dir=$DATA_DIR/neutron/ipsec
24 local pids
25 if [ -d $ipsec_data_dir ]; then
26 pids=$(find $ipsec_data_dir -name 'pluto.pid' -exec cat {} \;)
27 fi
28 if [ -n "$pids" ]; then
29 sudo kill $pids
30 fi
31}
32
Nachi Ueno69b3ff62013-06-07 10:28:33 -070033# Restore xtrace
Dean Troyere3a91602014-03-28 12:40:56 -050034$VPN_XTRACE