tripleo-heat-templates/puppet/puppet-steps.j2
Michele Baldessari bae48e60b3 Make sure PrePuppet runs before any Deployment_Step
We used to have this in mitaka:
https://github.com/openstack/tripleo-heat-templates/blob/stable/mitaka/puppet/controller-post.yaml#L45

but we lost it along the way. The problem without this change is that we
are open to the following race:
1) ControllerDeployment_Step1 is started and manages to do a successful
   "systemctl start pacemaker"
2) PrePuppet gets called and in the HA deployment calls
   pacemaker_maintenance_mode.sh
3) pacemaker_maintenance_mode.sh will set the maintenance-mode=true
   property because the pacemaker service is already up:
   https://github.com/openstack/tripleo-heat-templates/blob/master/extraconfig/tasks/pacemaker_maintenance_mode.sh#L8-L9
4) If the maintenance property is set to true at this stage, the
   creation of any resource will take place but they won't really
   start.

Change-Id: Icb7495edd00385b2975dd42f63085d20292ef9a9
Closes-Bug: #1673795
Co-Authored-By: Jiri Stransky <jstransk@redhat.com>
2017-03-17 15:36:50 +01:00

103 lines
3.2 KiB
Django/Jinja

# Post deployment steps for all roles
# A single config is re-applied with an incrementing step number
{% for role in roles %}
# {{role.name}} Role post-deploy steps
{{role.name}}ArtifactsConfig:
type: deploy-artifacts.yaml
{{role.name}}ArtifactsDeploy:
type: OS::Heat::StructuredDeployments
properties:
servers: {get_param: [servers, {{role.name}}]}
config: {get_resource: {{role.name}}ArtifactsConfig}
{{role.name}}PreConfig:
type: OS::TripleO::Tasks::{{role.name}}PreConfig
properties:
servers: {get_param: [servers, {{role.name}}]}
input_values:
update_identifier: {get_param: DeployIdentifier}
{{role.name}}Config:
type: OS::TripleO::{{role.name}}Config
properties:
StepConfig: {list_join: ["\n", {get_param: [role_data, {{role.name}}, step_config]}]}
{{role.name}}PrePuppet:
type: OS::TripleO::Tasks::{{role.name}}PrePuppet
properties:
servers: {get_param: [servers, {{role.name}}]}
input_values:
update_identifier: {get_param: DeployIdentifier}
{% if role.name in ['Controller', 'ObjectStorage'] %}
{{role.name}}SwiftRingDeploy:
type: OS::TripleO::Tasks::SwiftRingDeploy
properties:
servers: {get_param: [servers, {{role.name}}]}
{% endif %}
# Step through a series of configuration steps
{% for step in range(1, 6) %}
{{role.name}}Deployment_Step{{step}}:
type: OS::Heat::StructuredDeploymentGroup
{% if step == 1 %}
depends_on: [{{role.name}}PrePuppet, {{role.name}}PreConfig, {{role.name}}ArtifactsDeploy]
{% else %}
depends_on:
{% for dep in roles %}
- {{dep.name}}Deployment_Step{{step -1}}
{% endfor %}
{% endif %}
properties:
name: {{role.name}}Deployment_Step{{step}}
servers: {get_param: [servers, {{role.name}}]}
config: {get_resource: {{role.name}}Config}
input_values:
step: {{step}}
update_identifier: {get_param: DeployIdentifier}
{% endfor %}
{{role.name}}PostConfig:
type: OS::TripleO::Tasks::{{role.name}}PostConfig
depends_on:
{% for dep in roles %}
- {{dep.name}}Deployment_Step5
{% endfor %}
properties:
servers: {get_param: servers}
input_values:
update_identifier: {get_param: DeployIdentifier}
# Note, this should come last, so use depends_on to ensure
# this is created after any other resources.
{{role.name}}ExtraConfigPost:
depends_on:
{% for dep in roles %}
- {{dep.name}}PostConfig
{% endfor %}
type: OS::TripleO::NodeExtraConfigPost
properties:
servers: {get_param: [servers, {{role.name}}]}
{{role.name}}PostPuppet:
depends_on:
- {{role.name}}ExtraConfigPost
type: OS::TripleO::Tasks::{{role.name}}PostPuppet
properties:
servers: {get_param: [servers, {{role.name}}]}
input_values:
update_identifier: {get_param: DeployIdentifier}
{% if role.name in ['Controller', 'ObjectStorage'] %}
{{role.name}}SwiftRingUpdate:
type: OS::TripleO::Tasks::SwiftRingUpdate
depends_on:
{% for dep in roles %}
- {{dep.name}}Deployment_Step5
{% endfor %}
properties:
servers: {get_param: [servers, {{role.name}}]}
{% endif %}
{% endfor %}