tripleo-heat-templates/extraconfig/tasks/post_puppet_pacemaker.yaml
Steven Hardy ea1294fe9b Pacemaker maintenance mode for the duration of Puppet run on update
This enables pacemaker maintenantce mode when running Puppet on stack
update. Puppet can try to restart some overcloud services, which
pacemaker tries to prevent, and this can result in a failed Puppet run.

At the end of the puppet run, certain pacemaker resources are restarted
in an additional SoftwareDeployment to make sure that any config changes
have been fully applied. This is only done on stack updates (when
UpdateIdentifier is set to something), because the assumption is that on
stack create services already come up with the correct config.

(Change I9556085424fa3008d7f596578b58e7c33a336f75 has been squashed into
this one.)

Change-Id: I4d40358c511fc1f95b78a859e943082aaea17899
Co-Authored-By: Jiri Stransky <jistr@redhat.com>
Co-Authored-By: James Slagle <jslagle@redhat.com>
2015-12-14 14:24:13 +01:00

45 lines
1.3 KiB
YAML

heat_template_version: 2014-10-16
description: 'Post-Puppet Config for Pacemaker deployments'
parameters:
servers:
type: json
input_values:
type: json
description: input values for the software deployments
resources:
ControllerPostPuppetMaintenanceModeConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: |
#!/bin/bash
pacemaker_status=$(systemctl is-active pacemaker)
if [ "$pacemaker_status" = "active" ]; then
pcs property set maintenance-mode=false
fi
ControllerPostPuppetMaintenanceModeDeployment:
type: OS::Heat::SoftwareDeployments
properties:
servers: {get_param: servers}
config: {get_resource: ControllerPostPuppetMaintenanceModeConfig}
input_values: {get_param: input_values}
ControllerPostPuppetRestartConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: {get_file: pacemaker_resource_restart.sh}
ControllerPostPuppetRestartDeployment:
type: OS::Heat::SoftwareDeployments
depends_on: ControllerPostPuppetMaintenanceModeDeployment
properties:
servers: {get_param: servers}
config: {get_resource: ControllerPostPuppetRestartConfig}
input_values: {get_param: input_values}