Fix tasks dependency when using remote backends

Previously the LMA collector had an explicit dependency on the last
Elasticsearch task but this doesn't work when the Elasticsearch/Kibana
plugin isn't deployed in the same environment as the collector plugin.

This change makes sure that the LMA collector plugin's tasks will only
be executed once the Elasticsearch cluster is fully functional by
pinning both plugins to a well-known task (update_hosts in that case).

Partial-Bug: #1573087
Change-Id: I5bbc444eb51da4787b5be5cbe3aa0284ce6e1753
This commit is contained in:
Simon Pasquier 2016-04-22 16:15:20 +02:00
parent b464207e3f
commit 220046aa12
1 changed files with 18 additions and 11 deletions

View File

@ -1,4 +1,5 @@
# Groups definitions
####################
- id: primary-elasticsearch_kibana
type: group
version: 2.0.0
@ -38,9 +39,11 @@
strategy:
type: parallel
# Tasks definitions for deployment
#
# This task needs to be reexecuted to recheck the configuration
# Tasks definitions for the deployment
######################################
# This task needs to be reexecuted to recheck that the configuration parameters
# match the node's characteristics (eg JVM size).
- id: elasticsearch-check-configuration
type: puppet
version: 2.0.0
@ -53,8 +56,8 @@
reexecute_on:
- deploy_changes
# This task needs to be reexecuted to adapt configuration variables depending
# on the number of nodes in the cluster
# This task needs to be reexecuted to adapt the configuration parameters which
# depend on the number of nodes in the cluster
- id: elasticsearch-hiera
type: puppet
version: 2.0.0
@ -147,17 +150,21 @@
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
# Tasks definitions for post-deployment
#
# This task needs to be reexecuted to reconfigure index templates with an
# appropriate number_of_replicas. This is done at post_deployment time to
# ensure that the cluster is ready (the number of expected master nodes is reached)
# Tasks defintions for the post-deployment
##########################################
# This task needs to be reexecuted to reconfigure the index templates with an
# appropriate number_of_replicas.
# This is done at post_deployment time to ensure that the cluster is ready.
- id: elasticsearch-kibana-configuration
type: puppet
version: 2.0.0
role: [primary-elasticsearch_kibana]
requires: [post_deployment_start]
required_for: [post_deployment_end]
# We use update_hosts as an anchor to order the post-deployment tasks executed
# by this plugin and the LMA collector plugin. The dependency chain is like this:
# elasticsearch-kibana-configuration -> update_hosts -> (LMA collector tasks)
required_for: [update_hosts, post_deployment_end]
parameters:
puppet_manifest: puppet/manifests/provision_services.pp
puppet_modules: puppet/modules:/etc/puppet/modules