aboutsummaryrefslogtreecommitdiffstats
path: root/common/deploy-steps.j2
diff options
context:
space:
mode:
authorSteven Hardy <shardy@redhat.com>2017-07-21 11:43:25 +0100
committerEmilien Macchi <emilien@redhat.com>2017-08-12 10:40:48 +0000
commit1801565a75018fea1d6c8fd30543c9b238167652 (patch)
tree18fc7a95a821ea49d6f7f61ac530dabf096acbd0 /common/deploy-steps.j2
parent46279be9cb77ec9cf6e53e77c239a51efda06d80 (diff)
Add support for update_tasks
These work the same way as upgrade_tasks *but* they use a step variable instead of tags, so we can iterate over a count/sequence which isn't possibly via a wrapper playbook with tags (we may want to align upgrade tasks with the same approach if this works out well). Note the tasks can be run via ansible-playbook on the undercloud, like: openstack overcloud config download --config-dir tmpconfig cd tmpconfig/tripleo-HCrDA6-config ansible-playbook -b -i /usr/bin/tripleo-ansible-inventory update_steps_playbook.yaml --limit controller The above will do a rolling update for the Controller role (note the inconsistent capitalization, we probably need to fix the group naming in tripleo-ansible-inventory) because we specify serial: 1 in the playbook. You can also trigger an update explicitly on one node like this, which is useful for debugging: ansible-playbook -vvv -b -i /usr/bin/tripleo-ansible-inventory update_steps_playbook.yaml --limit overcloud-controller-0 Change-Id: I20bb3e26ab9d9cadf1a31fd304de8a014a901aa9
Diffstat (limited to 'common/deploy-steps.j2')
-rw-r--r--common/deploy-steps.j218
1 files changed, 18 insertions, 0 deletions
diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2
index 9cf4ead0..b798a67f 100644
--- a/common/deploy-steps.j2
+++ b/common/deploy-steps.j2
@@ -10,6 +10,7 @@
{%- set primary_role_name = primary_role[0].name -%}
# primary role is: {{primary_role_name}}
{% set deploy_steps_max = 6 -%}
+{% set update_steps_max = 6 -%}
heat_template_version: pike
@@ -319,4 +320,21 @@ outputs:
with_sequence: count={{deploy_steps_max-1}}
loop_control:
loop_var: step
+ update_steps_tasks: |
+{%- for role in roles %}
+ - include: {{role.name}}/update_tasks.yaml
+ when: role_name == '{{role.name}}'
+{%- endfor %}
+ update_steps_playbook: |
+ - hosts: overcloud
+ serial: 1
+ tasks:
+ - include: update_steps_tasks.yaml
+ with_sequence: count={{update_steps_max-1}}
+ loop_control:
+ loop_var: step
+ - include: deploy_steps_tasks.yaml
+ with_sequence: count={{deploy_steps_max-1}}
+ loop_control:
+ loop_var: step