Don't assume default network names in net_ip*map

This needs to handle a ServiceNetMap containing non-default
network names when they are overridden via the *NetName parameters.

Closes-Bug: #1651541
Change-Id: I95d808444642a37612a495e822e50449a7e7da63
This commit is contained in:
Steven Hardy 2016-12-21 13:19:20 +00:00
parent 24952e016f
commit 47f2579fa2
3 changed files with 212 additions and 52 deletions

View File

@ -35,6 +35,32 @@ parameters:
default: [] default: []
type: json type: json
InternalApiNetName:
default: internal_api
description: The name of the internal API network.
type: string
ExternalNetName:
default: external
description: The name of the external network.
type: string
ManagementNetName:
default: management
description: The name of the management network.
type: string
StorageNetName:
default: storage
description: The name of the storage network.
type: string
StorageMgmtNetName:
default: storage_mgmt
description: The name of the Storage management network.
type: string
TenantNetName:
default: tenant
description: The name of the tenant network.
type: string
resources: resources:
# This adds the extra "services" on for keystone # This adds the extra "services" on for keystone
# so that keystone_admin_api_network and # so that keystone_admin_api_network and
@ -58,19 +84,33 @@ resources:
- keystone_admin_api - keystone_admin_api
- keystone_public_api - keystone_public_api
outputs: NetIpMapValue:
net_ip_map: type: OS::Heat::Value
description: > properties:
A Hash containing a mapping of network names to assigned lists type: json
of IP addresses.
value: value:
ctlplane: {get_param: ControlPlaneIpList} map_replace:
- ctlplane: {get_param: ControlPlaneIpList}
external: {get_param: ExternalIpList} external: {get_param: ExternalIpList}
internal_api: {get_param: InternalApiIpList} internal_api: {get_param: InternalApiIpList}
storage: {get_param: StorageIpList} storage: {get_param: StorageIpList}
storage_mgmt: {get_param: StorageMgmtIpList} storage_mgmt: {get_param: StorageMgmtIpList}
tenant: {get_param: TenantIpList} tenant: {get_param: TenantIpList}
management: {get_param: ManagementIpList} management: {get_param: ManagementIpList}
- keys:
external: {get_param: ExternalNetName}
internal_api: {get_param: InternalApiNetName}
storage: {get_param: StorageNetName}
storage_mgmt: {get_param: StorageMgmtNetName}
tenant: {get_param: TenantNetName}
management: {get_param: ManagementNetName}
outputs:
net_ip_map:
description: >
A Hash containing a mapping of network names to assigned lists
of IP addresses.
value: {get_attr: [NetIpMapValue, value]}
service_ips: service_ips:
description: > description: >
Map of enabled services to a list of their IP addresses Map of enabled services to a list of their IP addresses
@ -92,14 +132,7 @@ outputs:
for_each: for_each:
SERVICE: {get_attr: [EnabledServicesValue, value]} SERVICE: {get_attr: [EnabledServicesValue, value]}
- values: {get_param: ServiceNetMap} - values: {get_param: ServiceNetMap}
- values: - values: {get_attr: [NetIpMapValue, value]}
ctlplane: {get_param: ControlPlaneIpList}
external: {get_param: ExternalIpList}
internal_api: {get_param: InternalApiIpList}
storage: {get_param: StorageIpList}
storage_mgmt: {get_param: StorageMgmtIpList}
tenant: {get_param: TenantIpList}
management: {get_param: ManagementIpList}
service_hostnames: service_hostnames:
description: > description: >
Map of enabled services to a list of hostnames where they're running Map of enabled services to a list of hostnames where they're running

View File

@ -69,13 +69,40 @@ parameters:
type: string type: string
description: IP address with brackets in case of IPv6 description: IP address with brackets in case of IPv6
outputs: InternalApiNetName:
net_ip_map: default: internal_api
description: > description: The name of the internal API network.
A Hash containing a mapping of network names to assigned IPs type: string
for a specific machine. ExternalNetName:
default: external
description: The name of the external network.
type: string
ManagementNetName:
default: management
description: The name of the management network.
type: string
StorageNetName:
default: storage
description: The name of the storage network.
type: string
StorageMgmtNetName:
default: storage_mgmt
description: The name of the Storage management network.
type: string
TenantNetName:
default: tenant
description: The name of the tenant network.
type: string
resources:
NetIpMapValue:
type: OS::Heat::Value
properties:
type: json
value: value:
ctlplane: {get_param: ControlPlaneIp} map_replace:
- ctlplane: {get_param: ControlPlaneIp}
external: {get_param: ExternalIp} external: {get_param: ExternalIp}
internal_api: {get_param: InternalApiIp} internal_api: {get_param: InternalApiIp}
storage: {get_param: StorageIp} storage: {get_param: StorageIp}
@ -101,3 +128,77 @@ outputs:
storage_mgmt_uri: {get_param: StorageMgmtIpUri} storage_mgmt_uri: {get_param: StorageMgmtIpUri}
tenant_uri: {get_param: TenantIpUri} tenant_uri: {get_param: TenantIpUri}
management_uri: {get_param: ManagementIpUri} management_uri: {get_param: ManagementIpUri}
- keys:
external: {get_param: ExternalNetName}
internal_api: {get_param: InternalApiNetName}
storage: {get_param: StorageNetName}
storage_mgmt: {get_param: StorageMgmtNetName}
tenant: {get_param: TenantNetName}
management: {get_param: ManagementNetName}
external_subnet:
str_replace:
template: NAME_subnet
params:
NAME: {get_param: ExternalNetName}
internal_api_subnet:
str_replace:
template: NAME_subnet
params:
NAME: {get_param: InternalApiNetName}
storage_subnet:
str_replace:
template: NAME_subnet
params:
NAME: {get_param: StorageNetName}
storage_mgmt_subnet:
str_replace:
template: NAME_subnet
params:
NAME: {get_param: StorageMgmtNetName}
tenant_subnet:
str_replace:
template: NAME_subnet
params:
NAME: {get_param: TenantNetName}
management_subnet:
str_replace:
template: NAME_subnet
params:
NAME: {get_param: ManagementNetName}
external_uri:
str_replace:
template: NAME_uri
params:
NAME: {get_param: ExternalNetName}
internal_api_uri:
str_replace:
template: NAME_uri
params:
NAME: {get_param: InternalApiNetName}
storage_uri:
str_replace:
template: NAME_uri
params:
NAME: {get_param: StorageNetName}
storage_mgmt_uri:
str_replace:
template: NAME_uri
params:
NAME: {get_param: StorageMgmtNetName}
tenant_uri:
str_replace:
template: NAME_uri
params:
NAME: {get_param: TenantNetName}
management_uri:
str_replace:
template: NAME_uri
params:
NAME: {get_param: ManagementNetName}
outputs:
net_ip_map:
description: >
A Hash containing a mapping of network names to assigned IPs
for a specific machine.
value: {get_attr: [NetIpMapValue, value]}

View File

@ -68,6 +68,32 @@ parameters:
type: boolean type: boolean
default: false default: false
InternalApiNetName:
default: internal_api
description: The name of the internal API network.
type: string
ExternalNetName:
default: external
description: The name of the external network.
type: string
ManagementNetName:
default: management
description: The name of the management network.
type: string
StorageNetName:
default: storage
description: The name of the storage network.
type: string
StorageMgmtNetName:
default: storage_mgmt
description: The name of the Storage management network.
type: string
TenantNetName:
default: tenant
description: The name of the tenant network.
type: string
resources: resources:
allNodesConfigImpl: allNodesConfigImpl:
@ -175,21 +201,21 @@ resources:
get_param: [NetVipMap, {get_param: [ServiceNetMap, keystone_admin_api_network]}] get_param: [NetVipMap, {get_param: [ServiceNetMap, keystone_admin_api_network]}]
keystone_public_api_vip: keystone_public_api_vip:
get_param: [NetVipMap, {get_param: [ServiceNetMap, keystone_public_api_network]}] get_param: [NetVipMap, {get_param: [ServiceNetMap, keystone_public_api_network]}]
public_virtual_ip: {get_param: [NetVipMap, external]} public_virtual_ip: {get_param: [NetVipMap, {get_param: ExternalNetName}]}
controller_virtual_ip: {get_param: [NetVipMap, ctlplane]} controller_virtual_ip: {get_param: [NetVipMap, ctlplane]}
internal_api_virtual_ip: {get_param: [NetVipMap, internal_api]} internal_api_virtual_ip: {get_param: [NetVipMap, {get_param: InternalApiNetName}]}
storage_virtual_ip: {get_param: [NetVipMap, storage]} storage_virtual_ip: {get_param: [NetVipMap, {get_param: StorageNetName}]}
storage_mgmt_virtual_ip: {get_param: [NetVipMap, storage_mgmt]} storage_mgmt_virtual_ip: {get_param: [NetVipMap, {get_param: StorageMgmtNetName}]}
redis_vip: {get_param: RedisVirtualIP} redis_vip: {get_param: RedisVirtualIP}
# public_virtual_ip and controller_virtual_ip are needed in # public_virtual_ip and controller_virtual_ip are needed in
# both HAproxy & keepalived. # both HAproxy & keepalived.
tripleo::haproxy::public_virtual_ip: {get_param: [NetVipMap, external]} tripleo::haproxy::public_virtual_ip: {get_param: [NetVipMap, {get_param: ExternalNetName}]}
tripleo::haproxy::controller_virtual_ip: {get_param: [NetVipMap, ctlplane]} tripleo::haproxy::controller_virtual_ip: {get_param: [NetVipMap, ctlplane]}
tripleo::keepalived::public_virtual_ip: {get_param: [NetVipMap, external]} tripleo::keepalived::public_virtual_ip: {get_param: [NetVipMap, {get_param: ExternalNetName}]}
tripleo::keepalived::controller_virtual_ip: {get_param: [NetVipMap, ctlplane]} tripleo::keepalived::controller_virtual_ip: {get_param: [NetVipMap, ctlplane]}
tripleo::keepalived::internal_api_virtual_ip: {get_param: [NetVipMap, internal_api]} tripleo::keepalived::internal_api_virtual_ip: {get_param: [NetVipMap, {get_param: InternalApiNetName}]}
tripleo::keepalived::storage_virtual_ip: {get_param: [NetVipMap, storage]} tripleo::keepalived::storage_virtual_ip: {get_param: [NetVipMap, {get_param: StorageNetName}]}
tripleo::keepalived::storage_mgmt_virtual_ip: {get_param: [NetVipMap, storage_mgmt]} tripleo::keepalived::storage_mgmt_virtual_ip: {get_param: [NetVipMap, {get_param: StorageMgmtNetName}]}
tripleo::keepalived::redis_virtual_ip: {get_param: RedisVirtualIP} tripleo::keepalived::redis_virtual_ip: {get_param: RedisVirtualIP}
tripleo::redis_notification::haproxy_monitor_ip: {get_param: [NetVipMap, ctlplane]} tripleo::redis_notification::haproxy_monitor_ip: {get_param: [NetVipMap, ctlplane]}
cloud_name_external: {get_param: cloud_name_external} cloud_name_external: {get_param: cloud_name_external}