From 2b4d6d16211cc55794b7d96594394f5e8c40fa4b Mon Sep 17 00:00:00 2001 From: Martin Hickey Date: Fri, 4 Dec 2015 14:40:03 +0000 Subject: [PATCH] Neutron VPNaaS: Use generated configuration files if available Generate the Neutron VPNaaS sample config files by using the oslo generator. The files are generated with a .sample extension and replace the static example configuration files. Once the generation code is delivered, the static config files will be removed. Change-Id: Icef8f7e8f0e8e78bfffa7a5af3f9f2300376b115 Related-blueprint: autogen-neutron-conf-file Partial-bug: #1199963 Depends-On: I4a6094b8218dfd320d05bfb1e3bc121e8930c551 --- lib/neutron-legacy | 6 ++++-- lib/neutron_plugins/services/vpn | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/neutron-legacy b/lib/neutron-legacy index caf89e3d8c..0089a0d4cf 100644 --- a/lib/neutron-legacy +++ b/lib/neutron-legacy @@ -1079,8 +1079,10 @@ function _configure_neutron_fwaas { } function _configure_neutron_vpn { - if [ -f $NEUTRON_VPNAAS_DIR/etc/neutron_vpnaas.conf ]; then - cp $NEUTRON_VPNAAS_DIR/etc/neutron_vpnaas.conf $NEUTRON_CONF_DIR + # Uses oslo config generator to generate VPNaaS sample configuration files + (cd $NEUTRON_VPNAAS_DIR && exec ./tools/generate_config_file_samples.sh) + if [ -f $NEUTRON_VPNAAS_DIR/etc/neutron_vpnaas.conf.sample ]; then + cp $NEUTRON_VPNAAS_DIR/etc/neutron_vpnaas.conf.sample $NEUTRON_CONF_DIR/neutron_vpnaas.conf fi neutron_vpn_install_agent_packages neutron_vpn_configure_common diff --git a/lib/neutron_plugins/services/vpn b/lib/neutron_plugins/services/vpn index 8a379f588c..e790913847 100644 --- a/lib/neutron_plugins/services/vpn +++ b/lib/neutron_plugins/services/vpn @@ -29,7 +29,9 @@ function neutron_vpn_configure_common { } function neutron_vpn_configure_agent { - cp $NEUTRON_VPNAAS_DIR/etc/vpn_agent.ini $Q_VPN_CONF_FILE + # Uses oslo config generator to generate LBaaS sample configuration files + (cd $NEUTRON_VPNAAS_DIR && exec ./tools/generate_config_file_samples.sh) + cp $NEUTRON_VPNAAS_DIR/etc/vpn_agent.ini.sample $Q_VPN_CONF_FILE if [[ "$IPSEC_PACKAGE" == "strongswan" ]]; then iniset_multiline $Q_VPN_CONF_FILE vpnagent vpn_device_driver neutron_vpnaas.services.vpn.device_drivers.strongswan_ipsec.StrongSwanDriver if is_fedora; then