Add RoleConfig output
authorSteven Hardy <shardy@redhat.com>
Thu, 20 Jul 2017 16:11:44 +0000 (17:11 +0100)
committerEmilien Macchi <emilien@redhat.com>
Sat, 12 Aug 2017 10:40:41 +0000 (10:40 +0000)
This exposes the deploy workflow for all roles from deploy-steps
via overcloud.j2.yaml - which means we can write it via the new
openstack overcloud config download command and/or run the workflow
outside of heat via mistral

With https://review.openstack.org/#/c/485732/ applied to
tripleoclient it becomes possible to do:

openstack overcloud config download --config-dir tmpconfig
cd tmpconfig/tripleo-EvEZk0-config
ansible-playbook -b -i /usr/bin/tripleo-ansible-inventory deploy_steps_playbook.yaml

This runs the deploy steps, exactly the same as normally run via heat
via ansible-playbook for all overcloud nodes (--limit can be used to restrict
to specific nodes/roles).

Change-Id: I96ec09bc788836584c4b39dcce5bf9b80e914c71

common/deploy-steps.j2
overcloud.j2.yaml

index bd8d9bc..9cf4ead 100644 (file)
@@ -302,3 +302,21 @@ resources:
 
 
 {% endfor %}
+
+outputs:
+  RoleConfig:
+    description: Mapping of config data for all roles
+    value:
+      deploy_steps_tasks: {get_file: deploy-steps-tasks.yaml}
+      deploy_steps_playbook: |
+        - hosts: overcloud
+          tasks:
+{%- for role in roles %}
+            - include: {{role.name}}/host_prep_tasks.yaml
+              when: role_name == '{{role.name}}'
+{%- endfor %}
+            - include: deploy_steps_tasks.yaml
+              with_sequence: count={{deploy_steps_max-1}}
+              loop_control:
+                loop_var: step
+
index 7241a97..a7a4fe2 100644 (file)
@@ -929,6 +929,9 @@ outputs:
         - {get_attr: [{{role.name}}ServiceChainRoleData, value]}
         - {get_attr: [{{role.name}}MergedConfigSettings, value]}
 {% endfor %}
+  RoleConfig:
+    description: The configuration workflows associated with each role
+    value: {get_attr: [AllNodesDeploySteps, RoleConfig]}
   RoleNetIpMap:
     description: Mapping of each network to a list of IPs for each role
     value: