From d0677947802059bcbc07aace2dfea2a866d9fd1c Mon Sep 17 00:00:00 2001 From: Sergey Kolekonov Date: Tue, 15 Dec 2015 16:14:10 +0300 Subject: [PATCH] Minor fixes for VPNaaS plugin - remove CentOS from releases - removed simple mode support - moved vpn agent switching off script to a separate file - remove vpn agent along with l3 during plugin deployment to resolve cluster downscaling issues Change-Id: I8663169eaf85bba08db919dc1fccfc6549baa00d --- deployment_scripts/disable_vpn_agent.sh | 5 +++ .../puppet/modules/vpnaas/manifests/ha.pp | 8 ++++- .../puppet/modules/vpnaas/manifests/init.pp | 6 +--- .../puppet/modules/vpnaas/manifests/simple.pp | 32 ------------------- metadata.yaml | 7 +--- tasks.yaml | 2 +- 6 files changed, 15 insertions(+), 45 deletions(-) create mode 100755 deployment_scripts/disable_vpn_agent.sh delete mode 100644 deployment_scripts/puppet/modules/vpnaas/manifests/simple.pp diff --git a/deployment_scripts/disable_vpn_agent.sh b/deployment_scripts/disable_vpn_agent.sh new file mode 100755 index 0000000..328d5e0 --- /dev/null +++ b/deployment_scripts/disable_vpn_agent.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +if [ -n "$(which pcs 2>/dev/null)" -a -n "$(pcs resource show p_neutron-vpn-agent 2>/dev/null)" ]; then + pcs resource disable p_neutron-vpn-agent --wait=60 +fi diff --git a/deployment_scripts/puppet/modules/vpnaas/manifests/ha.pp b/deployment_scripts/puppet/modules/vpnaas/manifests/ha.pp index c84e8f7..26e092a 100644 --- a/deployment_scripts/puppet/modules/vpnaas/manifests/ha.pp +++ b/deployment_scripts/puppet/modules/vpnaas/manifests/ha.pp @@ -44,7 +44,13 @@ class vpnaas::ha { onlyif => 'pcs resource show p_neutron-l3-agent 2>&1 > /dev/null', path => '/usr/sbin:/usr/bin:/sbin:/bin', } - Exec['remove_p_neutron-l3-agent'] -> Cluster::Corosync::Cs_service['vpn'] + exec {'remove_p_neutron-vpn-agent': + command => 'pcs resource delete p_neutron-vpn-agent --wait=60', + onlyif => 'pcs resource show p_neutron-vpn-agent 2>&1 > /dev/null', + path => '/usr/sbin:/usr/bin:/sbin:/bin', + } + Exec['remove_p_neutron-l3-agent'] -> Cluster::Corosync::Cs_service['vpn'] + Exec['remove_p_neutron-vpn-agent'] -> Cluster::Corosync::Cs_service['vpn'] } $csr_metadata = undef diff --git a/deployment_scripts/puppet/modules/vpnaas/manifests/init.pp b/deployment_scripts/puppet/modules/vpnaas/manifests/init.pp index 308a8e6..1ea12d9 100644 --- a/deployment_scripts/puppet/modules/vpnaas/manifests/init.pp +++ b/deployment_scripts/puppet/modules/vpnaas/manifests/init.pp @@ -20,9 +20,5 @@ class vpnaas { - if $cluster_mode == 'ha_compact' { - include vpnaas::ha - } else { - include vpnaas::simple - } + include vpnaas::ha } diff --git a/deployment_scripts/puppet/modules/vpnaas/manifests/simple.pp b/deployment_scripts/puppet/modules/vpnaas/manifests/simple.pp deleted file mode 100644 index f67f3cb..0000000 --- a/deployment_scripts/puppet/modules/vpnaas/manifests/simple.pp +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2015 Mirantis, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# == Class: vpnaas::simple -# -# This class deploys VPNaaS in simple mode. -# - -class vpnaas::simple { - - class {'vpnaas::agent':} - class {'vpnaas::common':} - - service { 'disable-neutron-l3-service': - ensure => stopped, - name => 'neutron-l3-agent', - enable => false, - } - - Service['disable-neutron-l3-service'] -> Class['vpnaas::agent'] -> Class['vpnaas::common'] -} diff --git a/metadata.yaml b/metadata.yaml index 81a73a8..c02c42c 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -21,14 +21,9 @@ groups: ['network'] releases: - os: ubuntu version: 2015.1-7.0 - mode: ['ha', 'multinode'] + mode: ['ha'] deployment_scripts_path: deployment_scripts/ repository_path: repositories/ubuntu - - os: centos - version: 2015.1-7.0 - mode: ['ha', 'multinode'] - deployment_scripts_path: deployment_scripts/ - repository_path: repositories/centos # Version of plugin package package_version: '2.0.0' diff --git a/tasks.yaml b/tasks.yaml index 514767f..eebb0ee 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -18,5 +18,5 @@ stage: pre_deployment type: shell parameters: - cmd: if [ -n "$(which pcs 2>/dev/null)" -a -n "$(pcs resource show p_neutron-vpn-agent 2>/dev/null)" ]; then pcs resource delete p_neutron-vpn-agent --wait=60; fi + cmd: ./disable_vpn_agent.sh timeout: 90