aboutsummaryrefslogtreecommitdiffstats
path: root/puppet/puppet-steps.j2
blob: c3b54ccd4ecb0976f55730a67c7823bddb74a38b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic
  # 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: {get_param: [role_data, {{role.name}}, step_config]}

  {% if role.name == 'Controller' %}
  ControllerPrePuppet:
    type: OS::TripleO::Tasks::ControllerPrePuppet
    properties:
      servers: {get_param: [servers, Controller]}
      input_values:
        update_identifier: {get_param: DeployIdentifier}
  {% 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}}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}}]}

  {% if role.name == 'Controller' %}
  ControllerPostPuppet:
    depends_on:
      - ControllerExtraConfigPost
    type: OS::TripleO::Tasks::ControllerPostPuppet
    properties:
      servers: {get_param: [servers, Controller]}
      input_values:
        update_identifier: {get_param: DeployIdentifier}
  {% endif %}
{% endfor %}