Allow map_replace substitution of network names
authorSteven Hardy <shardy@redhat.com>
Thu, 21 Jul 2016 15:24:09 +0000 (16:24 +0100)
committerSteven Hardy <shardy@redhat.com>
Tue, 9 Aug 2016 13:32:57 +0000 (14:32 +0100)
To allow per-node data such as bind_ip's to move into the
composable services templates, we do a value substitution
on the config settings hiera map, where e.g internal_api
will be replaced with the NetIpMap IP assigned to that.

To enable subnet/uri lookup via the same method, we add
all the subnet/uri mappings to the main net_ip_map output.

Change-Id: I7850d4dc8bf4db5f7ac6a6b53c1d900b561b4580

network/ports/net_ip_map.yaml
puppet/ceph-storage.yaml
puppet/cinder-storage.yaml
puppet/compute.yaml
puppet/controller.yaml
puppet/swift-storage.yaml

index 78c7c32..1ed7452 100644 (file)
@@ -82,6 +82,26 @@ outputs:
       storage_mgmt: {get_param: StorageMgmtIp}
       tenant: {get_param: TenantIp}
       management: {get_param: ManagementIp}
+      ctlplane_subnet:
+        list_join:
+          - ''
+          - - {get_param: ControlPlaneIp}
+            - '/'
+            - {get_param: ControlPlaneSubnetCidr}
+      external_subnet: {get_param: ExternalIpSubnet}
+      internal_api_subnet: {get_param: InternalApiIpSubnet}
+      storage_subnet: {get_param: StorageIpSubnet}
+      storage_mgmt_subnet: {get_param: StorageMgmtIpSubnet}
+      tenant_subnet: {get_param: TenantIpSubnet}
+      management_subnet: {get_param: ManagementIpSubnet}
+      ctlplane_uri: {get_param: ControlPlaneIp}
+      external_uri: {get_param: ExternalIpUri}
+      internal_api_uri: {get_param: InternalApiIpUri}
+      storage_uri: {get_param: StorageIpUri}
+      storage_mgmt_uri: {get_param: StorageMgmtIpUri}
+      tenant_uri: {get_param: TenantIpUri}
+      management_uri: {get_param: ManagementIpUri}
+  # net_ip_subnet_map is deprecated, please use *subnet from net_ip_map
   net_ip_subnet_map:
     description: >
       A Hash containing a mapping of network names to assigned IPs/CIDR
@@ -99,6 +119,7 @@ outputs:
       storage_mgmt: {get_param: StorageMgmtIpSubnet}
       tenant: {get_param: TenantIpSubnet}
       management: {get_param: ManagementIpSubnet}
+  # net_ip_uri_map is deprecated, please use *uri from net_ip_map
   net_ip_uri_map:
     description: >
       A Hash containing a mapping of network names to assigned IPs for a
index cc63261..ace9e15 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: 2015-04-30
+heat_template_version: 2016-10-14
 description: 'OpenStack ceph storage node configured by Puppet'
 parameters:
   OvercloudCephStorageFlavor:
@@ -264,7 +264,10 @@ resources:
               mapped_data:
                 service_names: {get_param: ServiceNames}
             service_configs:
-              mapped_data: {get_param: ServiceConfigSettings}
+              mapped_data:
+                map_replace:
+                  - {get_param: ServiceConfigSettings}
+                  - values: {get_attr: [NetIpMap, net_ip_map]}
             network:
               mapped_data:
                 net_ip_map: {get_attr: [NetIpMap, net_ip_map]}
index a987b8f..e4df6ae 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: 2015-04-30
+heat_template_version: 2016-10-14
 description: 'OpenStack cinder storage configured by Puppet'
 parameters:
   BlockStorageImage:
@@ -271,7 +271,10 @@ resources:
               mapped_data:
                 service_names: {get_param: ServiceNames}
             service_configs:
-              mapped_data: {get_param: ServiceConfigSettings}
+              mapped_data:
+                map_replace:
+                  - {get_param: ServiceConfigSettings}
+                  - values: {get_attr: [NetIpMap, net_ip_map]}
             network:
               mapped_data:
                 net_ip_map: {get_attr: [NetIpMap, net_ip_map]}
index dcb3c39..e029c60 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: 2015-10-15
+heat_template_version: 2016-10-14
 
 description: >
   OpenStack hypervisor node configured via Puppet.
@@ -382,7 +382,10 @@ resources:
               mapped_data:
                 service_names: {get_param: ServiceNames}
             service_configs:
-              mapped_data: {get_param: ServiceConfigSettings}
+              mapped_data:
+                map_replace:
+                  - {get_param: ServiceConfigSettings}
+                  - values: {get_attr: [NetIpMap, net_ip_map]}
             compute_extraconfig:
               mapped_data: {get_param: NovaComputeExtraConfig}
             extraconfig:
index 93f0e03..5734ce0 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: 2016-04-08
+heat_template_version: 2016-10-14
 
 description: >
   OpenStack controller node configured by Puppet.
@@ -625,7 +625,10 @@ resources:
               mapped_data:
                 service_names: {get_param: ServiceNames}
             service_configs:
-              mapped_data: {get_param: ServiceConfigSettings}
+              mapped_data:
+                map_replace:
+                  - {get_param: ServiceConfigSettings}
+                  - values: {get_attr: [NetIpMap, net_ip_map]}
             controller_extraconfig:
               mapped_data:
                 map_merge:
index 298b5bd..3553f77 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: 2015-04-30
+heat_template_version: 2016-10-14
 description: 'OpenStack swift storage node configured by Puppet'
 parameters:
   OvercloudSwiftStorageFlavor:
@@ -258,7 +258,10 @@ resources:
               mapped_data:
                 service_names: {get_param: ServiceNames}
             service_configs:
-              mapped_data: {get_param: ServiceConfigSettings}
+              mapped_data:
+                map_replace:
+                  - {get_param: ServiceConfigSettings}
+                  - values: {get_attr: [NetIpMap, net_ip_map]}
             network:
               mapped_data:
                 net_ip_map: {get_attr: [NetIpMap, net_ip_map]}