Support for contrail-analytics role added to experimental upgrade script

Change-Id: I8305aa502ed702ce57d621ab07b517309a7f29af
This commit is contained in:
Oleksandr Martsyniuk 2016-07-13 16:34:41 +03:00
parent 25b8a4d4c1
commit b1031c6b8e
6 changed files with 93 additions and 8 deletions

View File

@ -0,0 +1,21 @@
# Copyright 2016 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.
notice('MODULAR: contrail/upgrade-contrail-analytics.pp')
include contrail
Package <||> { ensure => latest }
class { 'contrail::analytics': }

View File

@ -19,5 +19,4 @@ include contrail
Package <||> { ensure => latest }
class { 'contrail::config': }
class { 'contrail::analytics': }
class { 'contrail::webui': }

View File

@ -12,9 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
notice('MODULAR: contrail/upgrade-contrail-stop.pp')
notice('MODULAR: contrail/upgrade-contrail-stop-analytics.pp')
# Stop cfgm and collector
service {['supervisor-config','supervisor-analytics']:
# Stop collector
service {'supervisor-analytics':
ensure => stopped,
}

View File

@ -0,0 +1,20 @@
# Copyright 2016 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.
notice('MODULAR: contrail/upgrade-contrail-stop-config.pp')
# Stop cfgm
service {'supervisor-config':
ensure => stopped,
}

View File

@ -50,6 +50,7 @@ get_nodes_list () {
start_task_on_node () {
local _nodes=$1
local _tasks=$2
fuel node --node-id $_nodes --task $_tasks 2>/dev/null
}
@ -97,9 +98,19 @@ controllers*)
start_task_on_node $nodes upgrade-contrail-pre
wait_for_tasks
# Stop the contrail collector and config services
# Stop the contrail config services
nodes=$(get_nodes_list contrail-config)
start_task_on_node $nodes upgrade-contrail-stop
start_task_on_node $nodes upgrade-contrail-stop-config
wait_for_tasks
# Stop the contrail collector services
nodes=$(get_nodes_list contrail-analytics)
if [ -n "$nodes" ]; then
start_task_on_node $nodes upgrade-contrail-stop-analytics
else
nodes_cfg=$(get_nodes_list contrail-config)
start_task_on_node $nodes_cfg upgrade-contrail-stop-analytics
fi
wait_for_tasks
# Start the upgrade tasks on database nodes
@ -112,6 +123,16 @@ controllers*)
start_task_on_node $nodes upgrade-contrail-config
wait_for_tasks
# Start the upgrade tasks on collector nodes
nodes=$(get_nodes_list contrail-analytics)
if [ -n "$nodes" ]; then
start_task_on_node $nodes upgrade-contrail-analytics
else
nodes_cfg=$(get_nodes_list contrail-config)
start_task_on_node $nodes_cfg upgrade-contrail-analytics
fi
wait_for_tasks
# Start the upgrade tasks on control nodes, one by one
nodes=$(get_nodes_list contrail-control)
for node in ${nodes//,/ }

View File

@ -8,20 +8,32 @@
requires: [post_deployment_start]
role: [primary-contrail-db, contrail-db,
primary-contrail-config,contrail-config,
primary-contrail-analytics,contrail-analytics,
primary-contrail-control,contrail-control]
parameters:
puppet_manifest: puppet/upgrade/upgrade-contrail-pre.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- id: upgrade-contrail-stop
- id: upgrade-contrail-stop-config
skipped: true
type: puppet
required_for: [post_deployment_end]
requires: [post_deployment_start]
role: [primary-contrail-config,contrail-config]
parameters:
puppet_manifest: puppet/upgrade/upgrade-contrail-stop.pp
puppet_manifest: puppet/upgrade/upgrade-contrail-stop-config.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- id: upgrade-contrail-stop-analytics
skipped: true
type: puppet
required_for: [post_deployment_end]
requires: [post_deployment_start]
role: [primary-contrail-config,contrail-config,primary-contrail-analytics,contrail-analytics]
parameters:
puppet_manifest: puppet/upgrade/upgrade-contrail-stop-analytics.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
@ -47,6 +59,17 @@
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- id: upgrade-contrail-analytics
skipped: true
type: puppet
required_for: [post_deployment_end]
requires: [post_deployment_start]
role: [primary-contrail-config,contrail-config,primary-contrail-analytics,contrail-analytics]
parameters:
puppet_manifest: puppet/upgrade/upgrade-contrail-analytics.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- id: upgrade-contrail-control
skipped: true
type: puppet
@ -65,6 +88,7 @@
requires: [post_deployment_start]
role: [primary-contrail-db, contrail-db,
primary-contrail-config,contrail-config,
primary-contrail-analytics,contrail-analytics,
primary-contrail-control,contrail-control]
parameters:
puppet_manifest: puppet/upgrade/upgrade-contrail-post.pp