Update to task based deployment

MOS 9 comes with a new orchestration engine (so-called v2 or task-based
deployement) which reduces greatly the time necessary to deploy new
environments.

This change updates the deployment tasks to be fully compatible with
the v2 engine since when a deployment mixes v1 and v2 tasks, the engine
falls back to the v1 (slower) mode.

Note that we need to keep the backward compatibility with MOS 8 so the
deployment tasks still define the v1 attributes like 'requires' and
'required_for'.

Change-Id: I5df3e649b2f31f2e1a5ccd59f346d870651315d5
This commit is contained in:
Guillaume Thouvenin 2016-03-16 11:04:07 +01:00
parent b93aa2faa3
commit b3291ab034
2 changed files with 133 additions and 111 deletions

View File

@ -1,5 +1,7 @@
# Groups definitions
- id: primary-influxdb_grafana
type: group
version: 2.0.0
role: [primary-influxdb_grafana]
tasks: &common_tasks
- hiera
@ -10,82 +12,33 @@
- logging
- netconfig
- hosts
required_for: [deploy_end]
- influxdb-hiera
- influxdb-firewall
- influxdb-cluster
- influxdb-cluster-haproxy
- influxdb-vip
- influxdb-haproxy
requires: [deploy_start]
required_for: [deploy_end]
parameters:
strategy:
type: one_by_one
- id: influxdb_grafana
type: group
version: 2.0.0
role: [influxdb_grafana]
tasks: *common_tasks
required_for: [deploy_end]
requires: [deploy_start, primary-influxdb_grafana]
required_for: [deploy_end]
parameters:
strategy:
type: parallel
- id: influxdb-firewall
type: puppet
groups: [primary-influxdb_grafana, influxdb_grafana]
required_for: [deploy_end]
requires: [netconfig]
parameters:
puppet_manifest: "puppet/manifests/firewall.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- id: influxdb-cluster
type: puppet
groups: [primary-influxdb_grafana, influxdb_grafana]
requires: [influxdb-firewall]
parameters:
puppet_manifest: "puppet/manifests/cluster.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: influxdb-cluster-haproxy
type: puppet
groups: [primary-influxdb_grafana, influxdb_grafana]
requires: [influxdb-cluster]
parameters:
puppet_manifest: "puppet/manifests/cluster-haproxy.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: influxdb-vip
type: puppet
groups: [primary-influxdb_grafana, influxdb_grafana]
required_for: [deploy_end]
requires: [influxdb-cluster]
parameters:
puppet_manifest: "/etc/puppet/modules/osnailyfacter/modular/virtual_ips/virtual_ips.pp"
puppet_modules: /etc/puppet/modules
timeout: 600
- id: influxdb-haproxy
type: puppet
groups: [primary-influxdb_grafana, influxdb_grafana]
required_for: [deploy_end]
requires: [influxdb-cluster-haproxy, influxdb-vip]
parameters:
puppet_manifest: "puppet/manifests/haproxy.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
# Tasks definitions for deployment
- id: influxdb-hiera
type: puppet
groups: [primary-influxdb_grafana, influxdb_grafana]
version: 2.0.0
requires: [globals]
required_for: [logging]
parameters:
@ -96,8 +49,69 @@
reexecute_on:
- deploy_changes
- id: influxdb-firewall
type: puppet
version: 2.0.0
requires: [netconfig]
required_for: [deploy_end]
parameters:
puppet_manifest: "puppet/manifests/firewall.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- id: influxdb-cluster
type: puppet
version: 2.0.0
requires: [influxdb-firewall]
required_for: [deploy_end]
parameters:
puppet_manifest: "puppet/manifests/cluster.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: influxdb-cluster-haproxy
type: puppet
version: 2.0.0
requires: [influxdb-cluster]
required_for: [deploy_end]
parameters:
puppet_manifest: "puppet/manifests/cluster-haproxy.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: influxdb-vip
type: puppet
version: 2.0.0
requires: [influxdb-cluster]
required_for: [deploy_end]
parameters:
puppet_manifest: "/etc/puppet/modules/osnailyfacter/modular/virtual_ips/virtual_ips.pp"
puppet_modules: /etc/puppet/modules
timeout: 600
- id: influxdb-haproxy
type: puppet
version: 2.0.0
requires: [influxdb-cluster-haproxy, influxdb-vip]
required_for: [deploy_end]
parameters:
puppet_manifest: "puppet/manifests/haproxy.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
# Tasks definitions for post-deployment
- id: influxdb-enable-quorum
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana]
requires: [post_deployment_start]
required_for: [post_deployment_end]
@ -108,3 +122,61 @@
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: influxdb-installation
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana, influxdb_grafana]
requires: [post_deployment_start]
required_for: [post_deployment_end]
parameters:
puppet_manifest: "puppet/manifests/influxdb.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- id: influxdb-configuration
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana]
requires: [post_deployment_start, influxdb-installation]
required_for: [post_deployment_end]
cross-depends:
- name: influxdb-installation
role: [primary-influxdb_grafana, influxdb_grafana]
parameters:
puppet_manifest: "puppet/manifests/influxdb_configuration.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- id: grafana-mysql-provisioning
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana]
requires: [post_deployment_start]
required_for: [post_deployment_end]
parameters:
puppet_manifest: "puppet/manifests/grafana_mysql.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- id: grafana-installation
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana, influxdb_grafana]
requires: [post_deployment_start, grafana-mysql-provisioning]
required_for: [post_deployment_end]
parameters:
puppet_manifest: "puppet/manifests/grafana.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- id: grafana-configuration
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana]
requires: [post_deployment_start, grafana-installation]
required_for: [post_deployment_end]
parameters:
puppet_manifest: "puppet/manifests/grafana_configuration.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600

View File

@ -1,51 +1 @@
# The following tasks are executed in the order they are declared
# Priorities are important, this ensure that this plugin is deployed before
# LMA Collector (priority 8200).
- role: ['primary-influxdb_grafana']
stage: post_deployment/8100
type: puppet
parameters:
puppet_manifest: puppet/manifests/influxdb.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- role: ['influxdb_grafana']
stage: post_deployment/8100
type: puppet
parameters:
puppet_manifest: puppet/manifests/influxdb.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- role: ['primary-influxdb_grafana']
stage: post_deployment/8100
type: puppet
parameters:
puppet_manifest: puppet/manifests/grafana_mysql.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- role: ['influxdb_grafana', 'primary-influxdb_grafana']
stage: post_deployment/8100
type: puppet
parameters:
puppet_manifest: puppet/manifests/grafana.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- role: ['primary-influxdb_grafana']
stage: post_deployment/8100
type: puppet
parameters:
puppet_manifest: puppet/manifests/influxdb_configuration.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- role: ['primary-influxdb_grafana']
stage: post_deployment/8100
type: puppet
parameters:
puppet_manifest: puppet/manifests/grafana_configuration.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
[]