Make keystone api network hiera composable

These hard-coded references to the Controller role mean that
things won't work if the keystone service is moved to any other
role, so we need to generate the lists dynamically based on the
enabled services for each role.

Change-Id: I5f1250a8a1a38cb3909feeb7d4c1000fd0fabd14
Closes-Bug: #1629096
This commit is contained in:
Steven Hardy 2016-09-30 15:23:26 +01:00
parent d601d64e11
commit c947008d9e
3 changed files with 25 additions and 24 deletions

View File

@ -32,6 +32,29 @@ parameters:
default: []
type: comma_delimited_list
resources:
# This adds the extra "services" on for keystone
# so that keystone_admin_api_network and
# keystone_public_api_network point to the correct
# network on the nodes running the "keystone" service
EnabledServicesValue:
type: OS::Heat::Value
properties:
type: comma_delimited_list
value:
yaql:
expression: let(root => $) -> $.data.extra_services.items().where($[0] in $root.data.enabled_services).select($[1]).flatten() + $root.data.enabled_services
data:
enabled_services: {get_param: EnabledServices}
extra_services:
# If anything other than keystone needs this
# then we should add an extra_networks interface
# to the service templates role_data but for
# now we hard-code the keystone special case
keystone:
- keystone_admin_api
- keystone_public_api
outputs:
net_ip_map:
description: >
@ -64,7 +87,7 @@ outputs:
template:
SERVICE_node_ips: SERVICE_network
for_each:
SERVICE: {get_param: EnabledServices}
SERVICE: {get_attr: [EnabledServicesValue, value]}
- values: {get_param: ServiceNetMap}
- values:
ctlplane: {get_param: ControlPlaneIpList}
@ -89,4 +112,4 @@ outputs:
template:
SERVICE_node_names: {get_param: ServiceHostnameList}
for_each:
SERVICE: {get_param: EnabledServices}
SERVICE: {get_attr: [EnabledServicesValue, value]}

View File

@ -340,8 +340,6 @@ resources:
{% 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]}]}
keystone_public_api_node_ips: {get_attr: [ControllerIpListMap, net_ip_map, {get_attr: [ServiceNetMap, service_net_map, KeystonePublicApiNetwork]}]}
keystone_admin_api_node_ips: {get_attr: [ControllerIpListMap, net_ip_map, {get_attr: [ServiceNetMap, service_net_map, KeystoneAdminApiNetwork]}]}
NetVipMap: {get_attr: [VipMap, net_ip_map]}
RedisVirtualIP: {get_attr: [RedisVirtualIP, ip_address]}
ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map_lower]}

View File

@ -28,10 +28,6 @@ parameters:
type: comma_delimited_list
memcache_node_ips:
type: comma_delimited_list
keystone_public_api_node_ips:
type: comma_delimited_list
keystone_admin_api_node_ips:
type: comma_delimited_list
NetVipMap:
type: json
RedisVirtualIP:
@ -136,22 +132,6 @@ resources:
list_join:
- "]','inet6:["
- {get_param: memcache_node_ips}
keystone_public_api_node_ips:
str_replace:
template: "['SERVERS_LIST']"
params:
SERVERS_LIST:
list_join:
- "','"
- {get_param: keystone_public_api_node_ips}
keystone_admin_api_node_ips:
str_replace:
template: "['SERVERS_LIST']"
params:
SERVERS_LIST:
list_join:
- "','"
- {get_param: keystone_admin_api_node_ips}
deploy_identifier: {get_param: DeployIdentifier}
update_identifier: {get_param: UpdateIdentifier}