j2 template per-role ServiceNetMapDefaults
authorSteven Hardy <shardy@redhat.com>
Tue, 4 Oct 2016 14:52:19 +0000 (15:52 +0100)
committerSteven Hardy <shardy@redhat.com>
Wed, 5 Oct 2016 07:54:08 +0000 (08:54 +0100)
The *HostnameResolveNetwork should default to a sane value
for all roles, including those specified by the user.

We choose internal_api by default (maintaining the existing
special-case for the CephStorage role which uses the storage
network), but users can of course override the default with
a network of their choice.

Change-Id: Ib240f56c1db5842b953fa510316e75fd53f24735
Closes-Bug: #1629827

network/service_net_map.j2.yaml [moved from network/service_net_map.yaml with 92% similarity]

similarity index 92%
rename from network/service_net_map.yaml
rename to network/service_net_map.j2.yaml
index 6e5c244..2f78133 100644 (file)
@@ -46,13 +46,14 @@ parameters:
       CephClusterNetwork: storage_mgmt
       CephMonNetwork: storage
       CephRgwNetwork: storage
-      ControllerHostnameResolveNetwork: internal_api
-      ComputeHostnameResolveNetwork: internal_api
-      BlockStorageHostnameResolveNetwork: internal_api
-      ObjectStorageHostnameResolveNetwork: internal_api
-      CephStorageHostnameResolveNetwork: storage
       PublicNetwork: external
       OpenDaylightApiNetwork: internal_api
+      # We special-case the default ResolveNetwork for the CephStorage role
+      # for backwards compatibility, all other roles default to internal_api
+      CephStorageHostnameResolveNetwork: storage
+{% for role in roles if role.name != 'CephStorage' %}
+      {{role.name}}HostnameResolveNetwork: internal_api
+{% endfor %}
     description: Mapping of service_name -> network name. Typically set
                  via parameter_defaults in the resource registry.
     type: json