diff options
author | 2017-04-11 11:44:46 +0100 | |
---|---|---|
committer | 2017-04-20 15:31:31 +0000 | |
commit | 0a5d85ea32cdc87c24099d41443bffc06718960b (patch) | |
tree | e81a22cb14caa7a9b7dc642f70b6ea52ce18cc92 /docker/docker-steps.j2 | |
parent | 29545646feafeb1c5eef5fd3ae096625834e852a (diff) |
Add defaults for docker puppet tasks
Currently we're referencing some steps that don't exist in the
output from the OS::Heat::Value resource, but as noted in the heat
bug #1681749 I think this isn't valid and probably should not be
allowed, so instead merge defaults with the non-empty step
tasks. To avoid further duplication of the loop variables, I
made the max step a variable.
Change-Id: Icf3d639b53c97006a0c370c12600449fba6f3323
Related-Bug: #1681749
Diffstat (limited to 'docker/docker-steps.j2')
-rw-r--r-- | docker/docker-steps.j2 | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/docker/docker-steps.j2 b/docker/docker-steps.j2 index f0af8e25..1cac152f 100644 --- a/docker/docker-steps.j2 +++ b/docker/docker-steps.j2 @@ -9,6 +9,8 @@ {%- endfor -%} {%- set primary_role_name = primary_role[0].name -%} # primary role is: {{primary_role_name}} +{% set deploy_steps_max = 6 -%} + heat_template_version: ocata description: > @@ -45,12 +47,16 @@ resources: value: yaql: expression: - dict($.data.docker_puppet_tasks.where($1 != null).selectMany($.items()).groupBy($[0], $[1])) + $.data.default_tasks + dict($.data.docker_puppet_tasks.where($1 != null).selectMany($.items()).groupBy($[0], $[1])) data: docker_puppet_tasks: {get_param: [role_data, {{primary_role_name}}, docker_puppet_tasks]} + default_tasks: +{%- for step in range(1, deploy_steps_max) %} + step_{{step}}: {} +{%- endfor %} # BEGIN primary_role_name docker-puppet-tasks (run only on a single node) -{% for step in range(1, 6) %} +{% for step in range(1, deploy_steps_max) %} {{primary_role_name}}DockerPuppetJsonConfig{{step}}: type: OS::Heat::StructuredConfig @@ -260,7 +266,7 @@ resources: properties: StepConfig: {get_attr: [{{role.name}}PuppetStepConfig, value]} - {% for step in range(1, 6) %} + {% for step in range(1, deploy_steps_max) %} {{role.name}}Deployment_Step{{step}}: type: OS::Heat::StructuredDeploymentGroup @@ -286,7 +292,7 @@ resources: # END BAREMETAL CONFIG STEPS # BEGIN CONTAINER CONFIG STEPS - {% for step in range(1, 6) %} + {% for step in range(1, deploy_steps_max) %} {{role.name}}ContainersConfig_Step{{step}}: type: OS::Heat::StructuredConfig |