Update the template_version alias for all the templates to pike.
[apex-tripleo-heat-templates.git] / overcloud.j2.yaml
index cb24002..e1c70dc 100644 (file)
@@ -1,5 +1,13 @@
-{% set primary_role_name = roles[0].name -%}
-heat_template_version: ocata
+{%- 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: pike
 
 description: >
   Deploy an OpenStack environment, consisting of several node types (roles),
@@ -43,7 +51,9 @@ parameters:
     type: string
   ControlFixedIPs:
     default: []
-    description: Should be used for arbitrary ips.
+    description: >
+        Control the IP allocation for the ControlVirtualIP port. E.g.
+        [{'ip_address':'1.2.3.4'}]
     type: json
   InternalApiVirtualFixedIPs:
     default: []
@@ -161,6 +171,11 @@ parameters:
     type: json
     description: Optional scheduler hints to pass to nova
     default: {}
+
+  {{role.name}}Parameters:
+    type: json
+    description: Optional Role Specific parameters to be provided to service
+    default: {}
 {% endfor %}
 
   # Identifiers to trigger tasks on nodes
@@ -254,6 +269,16 @@ resources:
       type: json
       value: {get_attr: [EndpointMap, endpoint_map]}
 
+  SshKnownHostsConfig:
+    type: OS::TripleO::Ssh::KnownHostsConfig
+    properties:
+      known_hosts:
+        list_join:
+          - ''
+          {% for role in roles %}
+          - {get_attr: [{{role.name}}, known_hosts_entry]}
+          {% endfor %}
+
   # Jinja loop for Role in roles_data.yaml
 {% for role in roles %}
   # Resources generated for {{role.name}} Role
@@ -265,6 +290,8 @@ resources:
       ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map]}
       EndpointMap: {get_attr: [EndpointMap, endpoint_map]}
       DefaultPasswords: {get_attr: [DefaultPasswords, passwords]}
+      RoleName: {{role.name}}
+      RoleParameters: {get_param: {{role.name}}Parameters}
 
   # Filter any null/None service_names which may be present due to mapping
   # of services to OS::Heat::None
@@ -285,6 +312,13 @@ resources:
       config: {get_attr: [hostsConfig, config_id]}
       servers: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
 
+  {{role.name}}SshKnownHostsDeployment:
+    type: OS::Heat::StructuredDeployments
+    properties:
+      name: {{role.name}}SshKnownHostsDeployment
+      config: {get_resource: SshKnownHostsConfig}
+      servers: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
+
   {{role.name}}AllNodesDeployment:
     type: OS::Heat::StructuredDeployments
     depends_on:
@@ -406,7 +440,7 @@ resources:
         -
 {% for role in roles %}
           - list_join:
-            - "\n"
+            - ""
             - {get_attr: [{{role.name}}, hosts_entry]}
 {% endfor %}
 
@@ -640,6 +674,7 @@ resources:
   AllNodesDeploySteps:
     type: OS::TripleO::PostDeploySteps
     depends_on:
+      - AllNodesExtraConfig
 {% for role in roles %}
       - {{role.name}}AllNodesDeployment
 {% endfor %}
@@ -691,4 +726,10 @@ outputs:
     value:
 {% for role in roles %}
       {{role.name}}: {get_attr: [{{role.name}}ServiceChain, role_data]}
+{% endfor %}
+  RoleNetIpMap:
+    description: Mapping of each network to a list of IPs for each role
+    value:
+{% for role in roles %}
+      {{role.name}}: {get_attr: [{{role.name}}IpListMap, net_ip_map]}
 {% endfor %}