Fix deployment for detach plugins

The collector services are managed by Pacemaker for the controller,
detached RabbitMQ and detached MySQL nodes. This change ensures that for
all these roles, the OCF script is created before the collector services
are configured.

Change-Id: I555b13f0433cccaa1297cd286dbb41d88de1d369
Closes-Bug: #1627968
This commit is contained in:
Simon Pasquier 2016-09-27 10:18:35 +02:00
parent 8bc835c74a
commit 276e331202
2 changed files with 14 additions and 68 deletions

View File

@ -14,14 +14,11 @@
notice('fuel-plugin-lma-collector: install_ocf_scripts.pp')
$node_profiles = hiera_hash('lma::collector::node_profiles')
if $node_profiles['controller'] or $node_profiles['rabbitmq'] or $node_profiles['mysql'] {
file { 'ocf-lma_collector':
ensure => present,
source => 'puppet:///modules/lma_collector/ocf-lma_collector',
path => '/usr/lib/ocf/resource.d/fuel/ocf-lma_collector',
mode => '0755',
owner => 'root',
group => 'root',
}
file { 'ocf-lma_collector':
ensure => present,
source => 'puppet:///modules/lma_collector/ocf-lma_collector',
path => '/usr/lib/ocf/resource.d/fuel/ocf-lma_collector',
mode => '0755',
owner => 'root',
group => 'root',
}

View File

@ -1,69 +1,25 @@
# Groups definitions
# ##################
- id: primary-controller
type: group
version: 2.0.0
role: [primary-controller]
tasks:
- lma-hiera-override
- install-ocf-script
requires: [deploy_start]
required_for: [deploy_end]
parameters:
strategy:
type: one_by_one
- id: controller
type: group
version: 2.0.0
role: [controller]
tasks:
- lma-hiera-override
- install-ocf-script
requires: [primary-controller]
required_for: [deploy_end]
parameters:
strategy:
type: parallel
# Tasks definitions for the deployment
# ####################################
- id: lma-hiera-override
type: puppet
version: 2.0.0
requires: [globals]
required_for: [logging]
parameters:
puppet_manifest: puppet/manifests/hiera_override.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
reexecute_on:
- deploy_changes
# The OCF script should exist before any nodes try to configure the
# collector services with Pacemaker.
- id: install-ocf-script
type: puppet
version: 2.0.0
requires: [fuel_pkgs, lma-hiera-override]
required_for: [cluster]
groups: [primary-controller, controller, primary-standalone-database, standalone-database, primary-standalone-rabbitmq, standalone-rabbitmq]
requires: [fuel_pkgs]
# Required for the cluster tasks when the environment is scaled up
required_for: [primary-cluster, cluster]
parameters:
puppet_manifest: puppet/manifests/install_ocf_script.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 120
reexecute_on:
- deploy_changes
# Tasks definitions for the post-deployment
# #########################################
# The Hiera data needs to be populated first so that other plugins (eg LMA
# Infrastructure Alerting) can use it. In the deployment phase, the hiera is
# executed only for controllers. We need to execute it for each role. It will
# be executed twice for controllers.
- id: lma-hiera-override-for-all
# Infrastructure Alerting) can use it.
- id: lma-hiera-override
type: puppet
version: 2.0.0
requires: [post_deployment_start]
@ -82,7 +38,7 @@
# We use upload_nodes_info as an anchor to order the post-deployment tasks executed
# by this plugin and the InfluxDB & Elasticsearch plugins. The dependency chain is:
# Other plugins tasks -> upload_nodes_info -> (LMA collector tasks)
requires: [post_deployment_start, upload_nodes_info, lma-hiera-override-for-all]
requires: [post_deployment_start, upload_nodes_info, lma-hiera-override]
required_for: [post_deployment_end]
role: '*'
parameters:
@ -98,13 +54,6 @@
requires: [lma-configure-apt]
required_for: [post_deployment_end]
role: '*'
# lma-configure-apt ships the OCF script so the task should wait for the
# script to be available on all the necessary nodes otherwise Pacemaker may
# fail to start the resource and keep it in failed state forever.
# See https://bugs.launchpad.net/lma-toolchain/+bug/1593137 for details
cross-depends:
- name: lma-configure-apt
role: /.*/
parameters:
puppet_manifest: puppet/manifests/base.pp
puppet_modules: puppet/modules:/etc/puppet/modules