Merge "Use underscore for Aodh and Gnocchi's container names"
[apex-tripleo-heat-templates.git] / docker / docker-steps.j2
index 301d838..f0af8e2 100644 (file)
@@ -1,7 +1,14 @@
 # certain initialization steps (run in a container) will occur
-# on the first role listed in the roles file
-{% set primary_role_name = roles[0].name -%}
-
+# on the role marked as primary controller or the first role listed
+{%- set primary_role = [roles[0]] -%}
+{%- for role in roles -%}
+  {%- if 'primary' in role.tags and 'controller' in role.tags -%}
+    {%- set _ = primary_role.pop() -%}
+    {%- set _ = primary_role.append(role) -%}
+  {%- endif -%}
+{%- endfor -%}
+{%- set primary_role_name = primary_role[0].name -%}
+# primary role is: {{primary_role_name}}
 heat_template_version: ocata
 
 description: >