b62502f8295f5140c308f4dc402f064e1c913afe
[apex-tripleo-heat-templates.git] / extraconfig / tasks / post_puppet_pacemaker.yaml
1 heat_template_version: 2014-10-16
2 description: 'Post-Puppet Config for Pacemaker deployments'
3
4 parameters:
5   servers:
6     type: json
7   input_values:
8      type: json
9      description: input values for the software deployments
10
11 resources:
12
13   ControllerPostPuppetMaintenanceModeConfig:
14     type: OS::Heat::SoftwareConfig
15     properties:
16       group: script
17       config: |
18         #!/bin/bash
19         pacemaker_status=$(systemctl is-active pacemaker)
20
21         if [ "$pacemaker_status" = "active" ]; then
22             pcs property set maintenance-mode=false
23         fi
24
25   ControllerPostPuppetMaintenanceModeDeployment:
26     type: OS::Heat::SoftwareDeployments
27     properties:
28       servers:  {get_param: servers}
29       config: {get_resource: ControllerPostPuppetMaintenanceModeConfig}
30       input_values: {get_param: input_values}
31
32   ControllerPostPuppetRestart:
33     type: OS::TripleO::Tasks::ControllerPostPuppetRestart
34     depends_on: ControllerPostPuppetMaintenanceModeDeployment
35     properties:
36       servers:  {get_param: servers}
37       input_values: {get_param: input_values}