Change flat network name for nosdn fdio scenario
[apex-tripleo-heat-templates.git] / puppet / role.role.j2.yaml
index f58f740..6e34cf7 100644 (file)
@@ -105,6 +105,11 @@ parameters:
     description: DEPRECATED - use {{role.name}}IPs instead
     type: json
 {%- endif %}
+  {{role.name}}NetworkDeploymentActions:
+    type: comma_delimited_list
+    description: >
+      Heat action when to apply network configuration changes
+    default: []
   NetworkDeploymentActions:
     type: comma_delimited_list
     description: >
@@ -265,6 +270,11 @@ conditions:
         - {get_param: {{role.deprecated_param_flavor}}}
         - {{default_flavor_name}}
 {%- endif %}
+  role_network_deployment_actions_exists:
+    not:
+      equals:
+        - {get_param: {{role.name}}NetworkDeploymentActions}
+        - []
 
 resources:
   {{server_resource_name}}:
@@ -467,6 +477,14 @@ resources:
             - '.'
             - - {get_attr: [{{server_resource_name}}, name]}
               - ctlplane
+        canonical:
+          fqdn:
+            list_join:
+            - '.'
+            - - {get_attr: [{{server_resource_name}}, name]}
+              - {get_param: CloudDomain}
+          short:
+            - {get_attr: [{{server_resource_name}}, name]}
 
   PreNetworkConfig:
     type: OS::TripleO::{{role.name}}::PreNetworkConfig
@@ -490,7 +508,10 @@ resources:
       actions:
         if:
           - server_not_blacklisted
-          - {get_param: NetworkDeploymentActions}
+          - if:
+            - role_network_deployment_actions_exists
+            - {get_param: {{role.name}}NetworkDeploymentActions}
+            - {get_param: NetworkDeploymentActions}
           - []
 
   {{server_resource_name}}UpgradeInitConfig:
@@ -552,6 +573,7 @@ resources:
           - bootstrap_node # provided by allNodesConfig
           - all_nodes # provided by allNodesConfig
           - vip_data # provided by allNodesConfig
+          - net_ip_map
           - '"%{::osfamily}"'
           # The following are required for compatibility with the Controller role
           # where some vendor integrations added hieradata via ExtraConfigPre
@@ -560,11 +582,13 @@ resources:
           - cisco_n1kv_data # Optionally provided by Controller/ComputeExtraConfigPre
           - midonet_data #Optionally provided by AllNodesExtraConfig
           - cisco_aci_data # Optionally provided by Controller/ComputeExtraConfigPre
+          - common # Optionally provided by os-net-config
         merge_behavior: deeper
         datafiles:
           service_names:
             service_names: {get_param: ServiceNames}
             sensu::subscriptions: {get_param: MonitoringSubscriptions}
+          net_ip_map: {get_attr: [NetIpMap, net_ip_map]}
           service_configs:
             map_replace:
               - {get_param: ServiceConfigSettings}
@@ -587,6 +611,7 @@ resources:
             fqdn_management: {get_attr: [NetHostMap, value, management, fqdn]}
             fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
             fqdn_external: {get_attr: [NetHostMap, value, external, fqdn]}
+            fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]}
 
   # Resource for site-specific injection of root certificate
   NodeTLSCAData:
@@ -681,6 +706,7 @@ outputs:
       {{network.name_lower|default(network.name.lower())}}: {get_attr: [NetHostMap, value, {{network.name_lower|default(network.name.lower()) }}, fqdn]}
   {%- endfor %}
       ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
+      canonical: {get_attr: [NetHostMap, value, canonical, fqdn]}
   hosts_entry:
     value:
       str_replace: