Fix issue when installing the OCF script

This patch moves the installation of the OCF script at the beginning of
the depoy_start to be sure that it is available when pacemaker starts
the collector resources. As it requires a configured hiera we also moved
the hiera task.

Change-Id: I90b4fa2a9038eaed0f1dcadb0f00713a1b2487b0
Closes-bug: #1575039
This commit is contained in:
Guillaume Thouvenin 2016-09-13 13:53:04 +02:00
parent 12cf9471dd
commit 8bc835c74a
3 changed files with 93 additions and 18 deletions

View File

@ -29,18 +29,3 @@ case $::osfamily {
# Currently only Debian like distributions need specific configuration.
}
}
$node_profiles = hiera_hash('lma::collector::node_profiles')
if $node_profiles['controller'] or $node_profiles['rabbitmq'] or $node_profiles['mysql'] {
# The OCF script should exist before any node tries to configure the
# collector services with Pacemaker. This is why it is shipped by this
# manifest.
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

@ -0,0 +1,27 @@
# 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('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',
}
}

View File

@ -1,6 +1,69 @@
# The Hiera data needs to be populated first so that other plugins (eg LMA
# Infrastructure Alerting) can use it
# 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]
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
type: puppet
version: 2.0.0
requires: [post_deployment_start]
@ -19,7 +82,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]
requires: [post_deployment_start, upload_nodes_info, lma-hiera-override-for-all]
required_for: [post_deployment_end]
role: '*'
parameters: