From 276e331202abc0ce9ebd54e154b56a805bf1c676 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Tue, 27 Sep 2016 10:18:35 +0200 Subject: [PATCH] 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 --- .../puppet/manifests/install_ocf_script.pp | 17 ++--- deployment_tasks.yaml | 65 ++----------------- 2 files changed, 14 insertions(+), 68 deletions(-) diff --git a/deployment_scripts/puppet/manifests/install_ocf_script.pp b/deployment_scripts/puppet/manifests/install_ocf_script.pp index d2e85d3e0..449104f55 100644 --- a/deployment_scripts/puppet/manifests/install_ocf_script.pp +++ b/deployment_scripts/puppet/manifests/install_ocf_script.pp @@ -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', } diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml index 238decb29..8652e495c 100644 --- a/deployment_tasks.yaml +++ b/deployment_tasks.yaml @@ -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