Browse code

Remove vpnaas code from devstack

This service is now configured by devstack plugin in master.

Change-Id: Ie5fc0d2a45c1b564f98c69ec9ea6fbdeeb465d32
(cherry picked from commit 1a791cbc449a3cfdbc3d3b94c6cda3ddefa17af4)

Ihar Hrachyshka authored on 2016/04/29 04:39:26
Showing 3 changed files
... ...
@@ -108,7 +108,6 @@ GITDIR["python-neutronclient"]=$DEST/python-neutronclient
108 108
 NEUTRON_DIR=$DEST/neutron
109 109
 NEUTRON_FWAAS_DIR=$DEST/neutron-fwaas
110 110
 NEUTRON_LBAAS_DIR=$DEST/neutron-lbaas
111
-NEUTRON_VPNAAS_DIR=$DEST/neutron-vpnaas
112 111
 NEUTRON_AUTH_CACHE_DIR=${NEUTRON_AUTH_CACHE_DIR:-/var/cache/neutron}
113 112
 
114 113
 # Support entry points installation of console scripts
... ...
@@ -125,9 +124,6 @@ export NEUTRON_TEST_CONFIG_FILE=${NEUTRON_TEST_CONFIG_FILE:-"$NEUTRON_CONF_DIR/d
125 125
 # Default provider for load balancer service
126 126
 DEFAULT_LB_PROVIDER=LOADBALANCER:Haproxy:neutron_lbaas.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
127 127
 
128
-# Default provider for VPN service
129
-DEFAULT_VPN_PROVIDER=VPN:openswan:neutron_vpnaas.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default
130
-
131 128
 # Agent binaries.  Note, binary paths for other agents are set in per-service
132 129
 # scripts in lib/neutron_plugins/services/
133 130
 AGENT_DHCP_BINARY="$NEUTRON_BIN_DIR/neutron-dhcp-agent"
... ...
@@ -139,7 +135,6 @@ AGENT_META_BINARY="$NEUTRON_BIN_DIR/neutron-metadata-agent"
139 139
 Q_DHCP_CONF_FILE=$NEUTRON_CONF_DIR/dhcp_agent.ini
140 140
 Q_L3_CONF_FILE=$NEUTRON_CONF_DIR/l3_agent.ini
141 141
 Q_FWAAS_CONF_FILE=$NEUTRON_CONF_DIR/fwaas_driver.ini
142
-Q_VPN_CONF_FILE=$NEUTRON_CONF_DIR/vpn_agent.ini
143 142
 Q_META_CONF_FILE=$NEUTRON_CONF_DIR/metadata_agent.ini
144 143
 
145 144
 # Default name for Neutron database
... ...
@@ -231,10 +226,6 @@ Q_L3_ROUTER_PER_TENANT=${Q_L3_ROUTER_PER_TENANT:-True}
231 231
 # See _configure_neutron_common() for details about setting it up
232 232
 declare -a Q_PLUGIN_EXTRA_CONF_FILES
233 233
 
234
-# List of (optional) config files for VPN device drivers to use with
235
-# the neutron-q-vpn agent
236
-declare -a Q_VPN_EXTRA_CONF_FILES
237
-
238 234
 
239 235
 Q_RR_CONF_FILE=$NEUTRON_CONF_DIR/rootwrap.conf
240 236
 if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
... ...
@@ -359,11 +350,6 @@ source $TOP_DIR/lib/neutron_plugins/services/loadbalancer
359 359
 # Hardcoding for 1 service plugin for now
360 360
 source $TOP_DIR/lib/neutron_plugins/services/metering
361 361
 
362
-# VPN service plugin functions
363
-# -------------------------------------------
364
-# Hardcoding for 1 service plugin for now
365
-source $TOP_DIR/lib/neutron_plugins/services/vpn
366
-
367 362
 # Firewall Service Plugin functions
368 363
 # ---------------------------------
369 364
 source $TOP_DIR/lib/neutron_plugins/services/firewall
... ...
@@ -392,19 +378,6 @@ function _determine_config_server {
392 392
     echo "$opts"
393 393
 }
394 394
 
395
-function _determine_config_vpn {
396
-    local cfg_file
397
-    local opts="--config-file $NEUTRON_CONF --config-file=$Q_L3_CONF_FILE --config-file=$Q_VPN_CONF_FILE"
398
-    if is_service_enabled q-fwaas; then
399
-        opts+=" --config-file $Q_FWAAS_CONF_FILE"
400
-    fi
401
-    for cfg_file in ${Q_VPN_EXTRA_CONF_FILES[@]}; do
402
-        opts+=" --config-file $cfg_file"
403
-    done
404
-    echo "$opts"
405
-
406
-}
407
-
408 395
 function _determine_config_l3 {
409 396
     local opts="--config-file $NEUTRON_CONF --config-file=$Q_L3_CONF_FILE"
410 397
     if is_service_enabled q-fwaas; then
... ...
@@ -419,7 +392,6 @@ function determine_config_files {
419 419
     local opts=""
420 420
     case "$1" in
421 421
         "neutron-server") opts="$(_determine_config_server)" ;;
422
-        "neutron-vpn-agent") opts="$(_determine_config_vpn)" ;;
423 422
         "neutron-l3-agent") opts="$(_determine_config_l3)" ;;
424 423
     esac
425 424
     if [ -z "$opts" ] ; then
... ...
@@ -449,10 +421,6 @@ function configure_neutron {
449 449
     if is_service_enabled q-metering; then
450 450
         _configure_neutron_metering
451 451
     fi
452
-    if is_service_enabled q-vpn; then
453
-        deprecated "Configuring q-vpn through devstack is deprecated"
454
-        _configure_neutron_vpn
455
-    fi
456 452
     if is_service_enabled q-fwaas; then
457 453
         deprecated "Configuring q-fwaas through devstack is deprecated"
458 454
         _configure_neutron_fwaas
... ...
@@ -660,10 +628,6 @@ function install_neutron {
660 660
         git_clone $NEUTRON_LBAAS_REPO $NEUTRON_LBAAS_DIR $NEUTRON_LBAAS_BRANCH
661 661
         setup_develop $NEUTRON_LBAAS_DIR
662 662
     fi
663
-    if is_service_enabled q-vpn; then
664
-        git_clone $NEUTRON_VPNAAS_REPO $NEUTRON_VPNAAS_DIR $NEUTRON_VPNAAS_BRANCH
665
-        setup_develop $NEUTRON_VPNAAS_DIR
666
-    fi
667 663
 
668 664
     if [ "$VIRT_DRIVER" == 'xenserver' ]; then
669 665
         local dom0_ip
... ...
@@ -762,8 +726,6 @@ function start_neutron_other_agents {
762 762
 
763 763
     if is_service_enabled neutron-vpnaas; then
764 764
         :  # Started by plugin
765
-    elif is_service_enabled q-vpn; then
766
-        run_process q-vpn "$AGENT_VPN_BINARY $(determine_config_files neutron-vpn-agent)"
767 765
     else
768 766
         run_process q-l3 "$AGENT_L3_BINARY $(determine_config_files neutron-l3-agent)"
769 767
     fi
... ...
@@ -814,9 +776,6 @@ function stop_neutron_other {
814 814
     if is_service_enabled q-fwaas; then
815 815
         neutron_fwaas_stop
816 816
     fi
817
-    if is_service_enabled q-vpn; then
818
-        neutron_vpn_stop
819
-    fi
820 817
     if is_service_enabled q-metering; then
821 818
         neutron_metering_stop
822 819
     fi
... ...
@@ -1070,10 +1029,6 @@ function _configure_neutron_dhcp_agent {
1070 1070
 function _configure_neutron_l3_agent {
1071 1071
     Q_L3_ENABLED=True
1072 1072
 
1073
-    if is_service_enabled q-vpn; then
1074
-        neutron_vpn_configure_agent
1075
-    fi
1076
-
1077 1073
     cp $NEUTRON_DIR/etc/l3_agent.ini.sample $Q_L3_CONF_FILE
1078 1074
 
1079 1075
     iniset $Q_L3_CONF_FILE DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
... ...
@@ -1133,17 +1088,6 @@ function _configure_neutron_fwaas {
1133 1133
     neutron_fwaas_configure_driver
1134 1134
 }
1135 1135
 
1136
-function _configure_neutron_vpn {
1137
-    # Uses oslo config generator to generate VPNaaS sample configuration files
1138
-    (cd $NEUTRON_VPNAAS_DIR && exec ./tools/generate_config_file_samples.sh)
1139
-    if [ -f $NEUTRON_VPNAAS_DIR/etc/neutron_vpnaas.conf.sample ]; then
1140
-        cp $NEUTRON_VPNAAS_DIR/etc/neutron_vpnaas.conf.sample $NEUTRON_CONF_DIR/neutron_vpnaas.conf
1141
-        iniset $NEUTRON_CONF_DIR/neutron_vpnaas.conf service_providers service_provider $DEFAULT_VPN_PROVIDER
1142
-    fi
1143
-    neutron_vpn_install_agent_packages
1144
-    neutron_vpn_configure_common
1145
-}
1146
-
1147 1136
 function _configure_dvr {
1148 1137
     iniset $NEUTRON_CONF DEFAULT router_distributed True
1149 1138
     iniset $Q_L3_CONF_FILE DEFAULT agent_mode $Q_DVR_MODE
1150 1139
deleted file mode 100644
... ...
@@ -1,58 +0,0 @@
1
-#!/bin/bash
2
-
3
-# Neutron VPN plugin
4
-# ---------------------------
5
-
6
-# Save trace setting
7
-_XTRACE_NEUTRON_VPN=$(set +o | grep xtrace)
8
-set +o xtrace
9
-
10
-
11
-AGENT_VPN_BINARY="$NEUTRON_BIN_DIR/neutron-vpn-agent"
12
-VPN_PLUGIN=${VPN_PLUGIN:-"neutron_vpnaas.services.vpn.plugin.VPNDriverPlugin"}
13
-IPSEC_PACKAGE=${IPSEC_PACKAGE:-"openswan"}
14
-
15
-function neutron_vpn_install_agent_packages {
16
-    install_package $IPSEC_PACKAGE
17
-    if is_ubuntu && [[ "$IPSEC_PACKAGE" == "strongswan" ]]; then
18
-        sudo ln -sf /etc/apparmor.d/usr.lib.ipsec.charon /etc/apparmor.d/disable/
19
-        sudo ln -sf /etc/apparmor.d/usr.lib.ipsec.stroke /etc/apparmor.d/disable/
20
-        # NOTE: Due to https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1387220
21
-        # one must use 'sudo start apparmor ACTION=reload' for Ubuntu 14.10
22
-        restart_service apparmor
23
-    fi
24
-}
25
-
26
-function neutron_vpn_configure_common {
27
-    _neutron_service_plugin_class_add $VPN_PLUGIN
28
-    _neutron_deploy_rootwrap_filters $NEUTRON_VPNAAS_DIR
29
-}
30
-
31
-function neutron_vpn_configure_agent {
32
-    # Uses oslo config generator to generate LBaaS sample configuration files
33
-    (cd $NEUTRON_VPNAAS_DIR && exec ./tools/generate_config_file_samples.sh)
34
-    cp $NEUTRON_VPNAAS_DIR/etc/vpn_agent.ini.sample $Q_VPN_CONF_FILE
35
-    if [[ "$IPSEC_PACKAGE" == "strongswan" ]]; then
36
-        iniset_multiline $Q_VPN_CONF_FILE vpnagent vpn_device_driver neutron_vpnaas.services.vpn.device_drivers.strongswan_ipsec.StrongSwanDriver
37
-        if is_fedora; then
38
-            iniset $Q_VPN_CONF_FILE strongswan default_config_area /usr/share/strongswan/templates/config/strongswan.d
39
-        fi
40
-    else
41
-        iniset_multiline $Q_VPN_CONF_FILE vpnagent vpn_device_driver neutron_vpnaas.services.vpn.device_drivers.ipsec.OpenSwanDriver
42
-    fi
43
-}
44
-
45
-function neutron_vpn_stop {
46
-    local ipsec_data_dir=$DATA_DIR/neutron/ipsec
47
-    local pids
48
-    if [ -d $ipsec_data_dir ]; then
49
-        pids=$(find $ipsec_data_dir -name 'pluto.pid' -exec cat {} \;)
50
-    fi
51
-    if [ -n "$pids" ]; then
52
-        sudo kill $pids
53
-    fi
54
-    stop_process q-vpn
55
-}
56
-
57
-# Restore xtrace
58
-$_XTRACE_NEUTRON_VPN
... ...
@@ -242,10 +242,6 @@ NEUTRON_FWAAS_BRANCH=${NEUTRON_FWAAS_BRANCH:-stable/mitaka}
242 242
 NEUTRON_LBAAS_REPO=${NEUTRON_LBAAS_REPO:-${GIT_BASE}/openstack/neutron-lbaas.git}
243 243
 NEUTRON_LBAAS_BRANCH=${NEUTRON_LBAAS_BRANCH:-stable/mitaka}
244 244
 
245
-# neutron vpnaas service
246
-NEUTRON_VPNAAS_REPO=${NEUTRON_VPNAAS_REPO:-${GIT_BASE}/openstack/neutron-vpnaas.git}
247
-NEUTRON_VPNAAS_BRANCH=${NEUTRON_VPNAAS_BRANCH:-stable/mitaka}
248
-
249 245
 # compute service
250 246
 NOVA_REPO=${NOVA_REPO:-${GIT_BASE}/openstack/nova.git}
251 247
 NOVA_BRANCH=${NOVA_BRANCH:-stable/mitaka}