Update net-config-noop to use apply-config
[apex-tripleo-heat-templates.git] / overcloud.j2.yaml
index f3a7126..d38bba2 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: 2016-10-14
+heat_template_version: ocata
 
 description: >
   Deploy an OpenStack environment, consisting of several node types (roles),
@@ -170,9 +170,50 @@ parameters:
     description: >
       Setting this to a unique value will re-run any deployment tasks which
       perform configuration on a Heat stack-update.
+  AddVipsToEtcHosts:
+    default: True
+    type: boolean
+    description: >
+      Set to true to append per network Vips to /etc/hosts on each node.
+
+conditions:
+  add_vips_to_etc_hosts: {equals : [{get_param: AddVipsToEtcHosts}, True]}
 
 resources:
 
+  VipHosts:
+    type: OS::Heat::Value
+    properties:
+      type: string
+      value:
+        list_join:
+        - "\n"
+        - - str_replace:
+              template: IP  HOST
+              params:
+                IP: {get_attr: [VipMap, net_ip_map, external]}
+                HOST: {get_param: CloudName}
+          - str_replace:
+              template: IP  HOST
+              params:
+                IP: {get_attr: [VipMap, net_ip_map, ctlplane]}
+                HOST: {get_param: CloudNameCtlplane}
+          - str_replace:
+              template: IP  HOST
+              params:
+                IP: {get_attr: [VipMap, net_ip_map, internal_api]}
+                HOST: {get_param: CloudNameInternal}
+          - str_replace:
+              template: IP  HOST
+              params:
+                IP: {get_attr: [VipMap, net_ip_map, storage]}
+                HOST: {get_param: CloudNameStorage}
+          - str_replace:
+              template: IP  HOST
+              params:
+                IP: {get_attr: [VipMap, net_ip_map, storage_mgmt]}
+                HOST: {get_param: CloudNameStorageManagement}
+
   HeatAuthEncryptionKey:
     type: OS::Heat::RandomString
 
@@ -322,15 +363,23 @@ resources:
                     services: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]}
           ServiceNames: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]}
           MonitoringSubscriptions: {get_attr: [{{role.name}}ServiceChain, role_data, monitoring_subscriptions]}
+          ServiceMetadataSettings: {get_attr: [{{role.name}}ServiceChain, role_data, service_metadata_settings]}
 {% endfor %}
 
   hostsConfig:
     type: OS::TripleO::Hosts::SoftwareConfig
     properties:
       hosts:
+        list_join:
+        - "\n"
+        - - if:
+            - add_vips_to_etc_hosts
+            - {get_attr: [VipHosts, value]}
+            - ''
+        -
 {% for role in roles %}
-        - list_join:
-            - '\n'
+          - list_join:
+            - "\n"
             - {get_attr: [{{role.name}}, hosts_entry]}
 {% endfor %}
 
@@ -395,6 +444,14 @@ resources:
             l:
 {% for role in roles %}
               - {get_attr: [{{role.name}}IpListMap, short_service_hostnames]}
+{% endfor %}
+      short_service_bootstrap_node:
+        yaql:
+          expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten().first()]))
+          data:
+            l:
+{% for role in roles %}
+              - {get_attr: [{{role.name}}IpListMap, short_service_bootstrap_hostnames]}
 {% endfor %}
       # FIXME(shardy): These require further work to move into service_ips
       memcache_node_ips: {get_attr: [ControllerIpListMap, net_ip_map, {get_attr: [ServiceNetMap, service_net_map, MemcachedNetwork]}]}
@@ -429,7 +486,7 @@ resources:
     type: OS::TripleO::Network
 
   ControlVirtualIP:
-    type: OS::Neutron::Port
+    type: OS::TripleO::Network::Ports::ControlPlaneVipPort
     depends_on: Networks
     properties:
       name: control_virtual_ip
@@ -539,9 +596,9 @@ resources:
       servers: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
 {% endfor %}
 
-  # Post deployment steps for all roles
-  AllNodesDeploySteps:
-    type: OS::TripleO::PostDeploySteps
+  # Upgrade steps for all roles
+  AllNodesUpgradeSteps:
+    type: OS::TripleO::UpgradeSteps
     depends_on:
 {% for role in roles %}
       - {{role.name}}AllNodesDeployment
@@ -556,6 +613,20 @@ resources:
         {{role.name}}: {get_attr: [{{role.name}}ServiceChain, role_data]}
 {% endfor %}
 
+  # Post deployment steps for all roles
+  AllNodesDeploySteps:
+    type: OS::TripleO::PostDeploySteps
+    depends_on: AllNodesUpgradeSteps
+    properties:
+      servers:
+{% for role in roles %}
+        {{role.name}}: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
+{% endfor %}
+      role_data:
+{% for role in roles %}
+        {{role.name}}: {get_attr: [{{role.name}}ServiceChain, role_data]}
+{% endfor %}
+
 outputs:
   ManagedEndpoints:
     description: Asserts that the keystone endpoints have been provisioned.
@@ -581,35 +652,16 @@ outputs:
       list_join:
       - "\n"
       - - {get_attr: [hostsConfig, hosts_entries]}
-      -
-        - str_replace:
-            template: IP  HOST
-            params:
-              IP: {get_attr: [VipMap, net_ip_map, external]}
-              HOST: {get_param: CloudName}
-        - str_replace:
-            template: IP  HOST
-            params:
-              IP: {get_attr: [VipMap, net_ip_map, ctlplane]}
-              HOST: {get_param: CloudNameCtlplane}
-        - str_replace:
-            template: IP  HOST
-            params:
-              IP: {get_attr: [VipMap, net_ip_map, internal_api]}
-              HOST: {get_param: CloudNameInternal}
-        - str_replace:
-            template: IP  HOST
-            params:
-              IP: {get_attr: [VipMap, net_ip_map, storage]}
-              HOST: {get_param: CloudNameStorage}
-        - str_replace:
-            template: IP  HOST
-            params:
-              IP: {get_attr: [VipMap, net_ip_map, storage_mgmt]}
-              HOST: {get_param: CloudNameStorageManagement}
+      - - {get_attr: [VipHosts, value]}
   EnabledServices:
     description: The services enabled on each role
     value:
 {% for role in roles %}
       {{role.name}}: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]}
+{% endfor %}
+  RoleData:
+    description: The configuration data associated with each role
+    value:
+{% for role in roles %}
+      {{role.name}}: {get_attr: [{{role.name}}ServiceChain, role_data]}
 {% endfor %}