diff options
Diffstat (limited to 'network')
-rw-r--r-- | network/endpoints/endpoint_data.yaml | 13 | ||||
-rw-r--r-- | network/endpoints/endpoint_map.yaml | 285 | ||||
-rwxr-xr-x | network/scripts/run-os-net-config.sh | 6 | ||||
-rw-r--r-- | network/service_net_map.j2.yaml | 69 |
4 files changed, 337 insertions, 36 deletions
diff --git a/network/endpoints/endpoint_data.yaml b/network/endpoints/endpoint_data.yaml index 6966f3d0..1b2f842c 100644 --- a/network/endpoints/endpoint_data.yaml +++ b/network/endpoints/endpoint_data.yaml @@ -28,6 +28,15 @@ Ceilometer: net_param: CeilometerApi port: 8777 +Ec2Api: + Internal: + net_param: Ec2Api + Public: + net_param: Public + Admin: + net_param: Ec2Api + port: 8788 + Gnocchi: Internal: net_param: GnocchiApi @@ -202,7 +211,7 @@ Nova: NovaPlacement: Internal: - net_param: NovaApi + net_param: NovaPlacement uri_suffixes: '': /placement Public: @@ -210,7 +219,7 @@ NovaPlacement: uri_suffixes: '': /placement Admin: - net_param: NovaApi + net_param: NovaPlacement uri_suffixes: '': /placement port: 8778 diff --git a/network/endpoints/endpoint_map.yaml b/network/endpoints/endpoint_map.yaml index 90986360..2d60df8b 100644 --- a/network/endpoints/endpoint_map.yaml +++ b/network/endpoints/endpoint_map.yaml @@ -34,6 +34,9 @@ parameters: CinderAdmin: {protocol: http, port: '8776', host: IP_ADDRESS} CinderInternal: {protocol: http, port: '8776', host: IP_ADDRESS} CinderPublic: {protocol: http, port: '8776', host: IP_ADDRESS} + Ec2ApiAdmin: {protocol: http, port: '8788', host: IP_ADDRESS} + Ec2ApiInternal: {protocol: http, port: '8788', host: IP_ADDRESS} + Ec2ApiPublic: {protocol: http, port: '8788', host: IP_ADDRESS} GlanceAdmin: {protocol: http, port: '9292', host: IP_ADDRESS} GlanceInternal: {protocol: http, port: '9292', host: IP_ADDRESS} GlancePublic: {protocol: http, port: '9292', host: IP_ADDRESS} @@ -1813,6 +1816,249 @@ outputs: template: NETWORK_uri - ':' - get_param: [EndpointMap, CinderPublic, port] + Ec2ApiAdmin: + host: + str_replace: + template: + get_param: [EndpointMap, Ec2ApiAdmin, host] + params: + CLOUDNAME: + get_param: + - CloudEndpoints + - get_param: [ServiceNetMap, Ec2ApiNetwork] + IP_ADDRESS: + get_param: + - NetIpMap + - str_replace: + params: + NETWORK: + get_param: [ServiceNetMap, Ec2ApiNetwork] + template: NETWORK_uri + host_nobrackets: + str_replace: + template: + get_param: [EndpointMap, Ec2ApiAdmin, host] + params: + CLOUDNAME: + get_param: + - CloudEndpoints + - get_param: [ServiceNetMap, Ec2ApiNetwork] + IP_ADDRESS: + get_param: + - NetIpMap + - get_param: [ServiceNetMap, Ec2ApiNetwork] + port: + get_param: [EndpointMap, Ec2ApiAdmin, port] + protocol: + get_param: [EndpointMap, Ec2ApiAdmin, protocol] + uri: + list_join: + - '' + - - get_param: [EndpointMap, Ec2ApiAdmin, protocol] + - :// + - str_replace: + template: + get_param: [EndpointMap, Ec2ApiAdmin, host] + params: + CLOUDNAME: + get_param: + - CloudEndpoints + - get_param: [ServiceNetMap, Ec2ApiNetwork] + IP_ADDRESS: + get_param: + - NetIpMap + - str_replace: + params: + NETWORK: + get_param: [ServiceNetMap, Ec2ApiNetwork] + template: NETWORK_uri + - ':' + - get_param: [EndpointMap, Ec2ApiAdmin, port] + uri_no_suffix: + list_join: + - '' + - - get_param: [EndpointMap, Ec2ApiAdmin, protocol] + - :// + - str_replace: + template: + get_param: [EndpointMap, Ec2ApiAdmin, host] + params: + CLOUDNAME: + get_param: + - CloudEndpoints + - get_param: [ServiceNetMap, Ec2ApiNetwork] + IP_ADDRESS: + get_param: + - NetIpMap + - str_replace: + params: + NETWORK: + get_param: [ServiceNetMap, Ec2ApiNetwork] + template: NETWORK_uri + - ':' + - get_param: [EndpointMap, Ec2ApiAdmin, port] + Ec2ApiInternal: + host: + str_replace: + template: + get_param: [EndpointMap, Ec2ApiInternal, host] + params: + CLOUDNAME: + get_param: + - CloudEndpoints + - get_param: [ServiceNetMap, Ec2ApiNetwork] + IP_ADDRESS: + get_param: + - NetIpMap + - str_replace: + params: + NETWORK: + get_param: [ServiceNetMap, Ec2ApiNetwork] + template: NETWORK_uri + host_nobrackets: + str_replace: + template: + get_param: [EndpointMap, Ec2ApiInternal, host] + params: + CLOUDNAME: + get_param: + - CloudEndpoints + - get_param: [ServiceNetMap, Ec2ApiNetwork] + IP_ADDRESS: + get_param: + - NetIpMap + - get_param: [ServiceNetMap, Ec2ApiNetwork] + port: + get_param: [EndpointMap, Ec2ApiInternal, port] + protocol: + get_param: [EndpointMap, Ec2ApiInternal, protocol] + uri: + list_join: + - '' + - - get_param: [EndpointMap, Ec2ApiInternal, protocol] + - :// + - str_replace: + template: + get_param: [EndpointMap, Ec2ApiInternal, host] + params: + CLOUDNAME: + get_param: + - CloudEndpoints + - get_param: [ServiceNetMap, Ec2ApiNetwork] + IP_ADDRESS: + get_param: + - NetIpMap + - str_replace: + params: + NETWORK: + get_param: [ServiceNetMap, Ec2ApiNetwork] + template: NETWORK_uri + - ':' + - get_param: [EndpointMap, Ec2ApiInternal, port] + uri_no_suffix: + list_join: + - '' + - - get_param: [EndpointMap, Ec2ApiInternal, protocol] + - :// + - str_replace: + template: + get_param: [EndpointMap, Ec2ApiInternal, host] + params: + CLOUDNAME: + get_param: + - CloudEndpoints + - get_param: [ServiceNetMap, Ec2ApiNetwork] + IP_ADDRESS: + get_param: + - NetIpMap + - str_replace: + params: + NETWORK: + get_param: [ServiceNetMap, Ec2ApiNetwork] + template: NETWORK_uri + - ':' + - get_param: [EndpointMap, Ec2ApiInternal, port] + Ec2ApiPublic: + host: + str_replace: + template: + get_param: [EndpointMap, Ec2ApiPublic, host] + params: + CLOUDNAME: + get_param: + - CloudEndpoints + - get_param: [ServiceNetMap, PublicNetwork] + IP_ADDRESS: + get_param: + - NetIpMap + - str_replace: + params: + NETWORK: + get_param: [ServiceNetMap, PublicNetwork] + template: NETWORK_uri + host_nobrackets: + str_replace: + template: + get_param: [EndpointMap, Ec2ApiPublic, host] + params: + CLOUDNAME: + get_param: + - CloudEndpoints + - get_param: [ServiceNetMap, PublicNetwork] + IP_ADDRESS: + get_param: + - NetIpMap + - get_param: [ServiceNetMap, PublicNetwork] + port: + get_param: [EndpointMap, Ec2ApiPublic, port] + protocol: + get_param: [EndpointMap, Ec2ApiPublic, protocol] + uri: + list_join: + - '' + - - get_param: [EndpointMap, Ec2ApiPublic, protocol] + - :// + - str_replace: + template: + get_param: [EndpointMap, Ec2ApiPublic, host] + params: + CLOUDNAME: + get_param: + - CloudEndpoints + - get_param: [ServiceNetMap, PublicNetwork] + IP_ADDRESS: + get_param: + - NetIpMap + - str_replace: + params: + NETWORK: + get_param: [ServiceNetMap, PublicNetwork] + template: NETWORK_uri + - ':' + - get_param: [EndpointMap, Ec2ApiPublic, port] + uri_no_suffix: + list_join: + - '' + - - get_param: [EndpointMap, Ec2ApiPublic, protocol] + - :// + - str_replace: + template: + get_param: [EndpointMap, Ec2ApiPublic, host] + params: + CLOUDNAME: + get_param: + - CloudEndpoints + - get_param: [ServiceNetMap, PublicNetwork] + IP_ADDRESS: + get_param: + - NetIpMap + - str_replace: + params: + NETWORK: + get_param: [ServiceNetMap, PublicNetwork] + template: NETWORK_uri + - ':' + - get_param: [EndpointMap, Ec2ApiPublic, port] GlanceAdmin: host: str_replace: @@ -5010,14 +5256,14 @@ outputs: CLOUDNAME: get_param: - CloudEndpoints - - get_param: [ServiceNetMap, NovaApiNetwork] + - get_param: [ServiceNetMap, NovaPlacementNetwork] IP_ADDRESS: get_param: - NetIpMap - str_replace: params: NETWORK: - get_param: [ServiceNetMap, NovaApiNetwork] + get_param: [ServiceNetMap, NovaPlacementNetwork] template: NETWORK_uri host_nobrackets: str_replace: @@ -5027,11 +5273,11 @@ outputs: CLOUDNAME: get_param: - CloudEndpoints - - get_param: [ServiceNetMap, NovaApiNetwork] + - get_param: [ServiceNetMap, NovaPlacementNetwork] IP_ADDRESS: get_param: - NetIpMap - - get_param: [ServiceNetMap, NovaApiNetwork] + - get_param: [ServiceNetMap, NovaPlacementNetwork] port: get_param: [EndpointMap, NovaPlacementAdmin, port] protocol: @@ -5048,14 +5294,14 @@ outputs: CLOUDNAME: get_param: - CloudEndpoints - - get_param: [ServiceNetMap, NovaApiNetwork] + - get_param: [ServiceNetMap, NovaPlacementNetwork] IP_ADDRESS: get_param: - NetIpMap - str_replace: params: NETWORK: - get_param: [ServiceNetMap, NovaApiNetwork] + get_param: [ServiceNetMap, NovaPlacementNetwork] template: NETWORK_uri - ':' - get_param: [EndpointMap, NovaPlacementAdmin, port] @@ -5072,18 +5318,17 @@ outputs: CLOUDNAME: get_param: - CloudEndpoints - - get_param: [ServiceNetMap, NovaApiNetwork] + - get_param: [ServiceNetMap, NovaPlacementNetwork] IP_ADDRESS: get_param: - NetIpMap - str_replace: params: NETWORK: - get_param: [ServiceNetMap, NovaApiNetwork] + get_param: [ServiceNetMap, NovaPlacementNetwork] template: NETWORK_uri - ':' - get_param: [EndpointMap, NovaPlacementAdmin, port] - - /placement NovaPlacementInternal: host: str_replace: @@ -5093,14 +5338,14 @@ outputs: CLOUDNAME: get_param: - CloudEndpoints - - get_param: [ServiceNetMap, NovaApiNetwork] + - get_param: [ServiceNetMap, NovaPlacementNetwork] IP_ADDRESS: get_param: - NetIpMap - str_replace: params: NETWORK: - get_param: [ServiceNetMap, NovaApiNetwork] + get_param: [ServiceNetMap, NovaPlacementNetwork] template: NETWORK_uri host_nobrackets: str_replace: @@ -5110,11 +5355,11 @@ outputs: CLOUDNAME: get_param: - CloudEndpoints - - get_param: [ServiceNetMap, NovaApiNetwork] + - get_param: [ServiceNetMap, NovaPlacementNetwork] IP_ADDRESS: get_param: - NetIpMap - - get_param: [ServiceNetMap, NovaApiNetwork] + - get_param: [ServiceNetMap, NovaPlacementNetwork] port: get_param: [EndpointMap, NovaPlacementInternal, port] protocol: @@ -5131,14 +5376,14 @@ outputs: CLOUDNAME: get_param: - CloudEndpoints - - get_param: [ServiceNetMap, NovaApiNetwork] + - get_param: [ServiceNetMap, NovaPlacementNetwork] IP_ADDRESS: get_param: - NetIpMap - str_replace: params: NETWORK: - get_param: [ServiceNetMap, NovaApiNetwork] + get_param: [ServiceNetMap, NovaPlacementNetwork] template: NETWORK_uri - ':' - get_param: [EndpointMap, NovaPlacementInternal, port] @@ -5155,18 +5400,17 @@ outputs: CLOUDNAME: get_param: - CloudEndpoints - - get_param: [ServiceNetMap, NovaApiNetwork] + - get_param: [ServiceNetMap, NovaPlacementNetwork] IP_ADDRESS: get_param: - NetIpMap - str_replace: params: NETWORK: - get_param: [ServiceNetMap, NovaApiNetwork] + get_param: [ServiceNetMap, NovaPlacementNetwork] template: NETWORK_uri - ':' - get_param: [EndpointMap, NovaPlacementInternal, port] - - /placement NovaPlacementPublic: host: str_replace: @@ -5243,13 +5487,12 @@ outputs: get_param: - NetIpMap - str_replace: - params: + params: NETWORK: get_param: [ServiceNetMap, PublicNetwork] - template: NETWORK_uri + template: NETWORK_uri - ':' - get_param: [EndpointMap, NovaPlacementPublic, port] - - /placement NovaVNCProxyAdmin: host: str_replace: diff --git a/network/scripts/run-os-net-config.sh b/network/scripts/run-os-net-config.sh index a7dbedc7..8fe2d270 100755 --- a/network/scripts/run-os-net-config.sh +++ b/network/scripts/run-os-net-config.sh @@ -10,7 +10,7 @@ # a deployment input via input_values # $network_config : the json serialized os-net-config config to apply # -set -ux +set -eux function get_metadata_ip() { @@ -98,8 +98,10 @@ EOF_CAT fi fi done + set +e os-net-config -c /etc/os-net-config/dhcp_all_interfaces.yaml -v --detailed-exit-codes --cleanup RETVAL=$? + set -e if [[ $RETVAL == 2 ]]; then ping_metadata_ip elif [[ $RETVAL != 0 ]]; then @@ -123,8 +125,10 @@ if [ -n '$network_config' ]; then sed -i "s/bridge_name/${bridge_name:-''}/" /etc/os-net-config/config.json sed -i "s/interface_name/${interface_name:-''}/" /etc/os-net-config/config.json + set +e os-net-config -c /etc/os-net-config/config.json -v --detailed-exit-codes RETVAL=$? + set -e if [[ $RETVAL == 2 ]]; then ping_metadata_ip diff --git a/network/service_net_map.j2.yaml b/network/service_net_map.j2.yaml index a8620ea7..390b18b4 100644 --- a/network/service_net_map.j2.yaml +++ b/network/service_net_map.j2.yaml @@ -21,6 +21,9 @@ parameters: # snake_case - the names must still match when converted ServiceNetMapDefaults: default: + # Note the values in this map are replaced by *NetName + # to allow for sane defaults when the network names are + # overridden. ApacheNetwork: internal_api NeutronTenantNetwork: tenant CeilometerApiNetwork: internal_api @@ -43,8 +46,11 @@ parameters: HeatApiCfnNetwork: internal_api HeatApiCloudwatchNetwork: internal_api NovaApiNetwork: internal_api + NovaPlacementNetwork: internal_api NovaMetadataNetwork: internal_api NovaVncProxyNetwork: internal_api + Ec2ApiNetwork: internal_api + Ec2ApiMetadataNetwork: internal_api SwiftStorageNetwork: storage_mgmt SwiftProxyNetwork: storage SaharaApiNetwork: internal_api @@ -61,9 +67,11 @@ parameters: OvnDbsNetwork: internal_api MistralApiNetwork: internal_api ZaqarApiNetwork: internal_api + PacemakerRemoteNetwork: internal_api # We special-case the default ResolveNetwork for the CephStorage role # for backwards compatibility, all other roles default to internal_api CephStorageHostnameResolveNetwork: storage + EtcdNetwork: internal_api {% for role in roles if role.name != 'CephStorage' %} {{role.name}}HostnameResolveNetwork: internal_api {% endfor %} @@ -83,20 +91,62 @@ parameters: internal use only, this will be removed in future. 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 + + parameter_groups: - label: deprecated description: Do not use deprecated params, they will be removed. parameters: - ServiceNetMapDeprecatedMapping +resources: + ServiceNetMapValue: + type: OS::Heat::Value + properties: + type: json + value: + map_merge: + - map_replace: + - {get_param: ServiceNetMapDefaults} + - values: + 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} + - map_replace: + - {get_param: ServiceNetMap} + - keys: {get_param: ServiceNetMapDeprecatedMapping} + + outputs: service_net_map: - value: - map_merge: - - {get_param: ServiceNetMapDefaults} - - map_replace: - - {get_param: ServiceNetMap} - - keys: {get_param: ServiceNetMapDeprecatedMapping} + value: {get_attr: [ServiceNetMapValue, value]} service_net_map_lower: value: @@ -106,9 +156,4 @@ outputs: yaql: expression: dict($.data.map.items().select([ regex(`([a-z0-9])([A-Z])`).replace($[0], '\\1_\\2').toLower(), $[1]])) data: - map: - map_merge: - - {get_param: ServiceNetMapDefaults} - - map_replace: - - {get_param: ServiceNetMap} - - keys: {get_param: ServiceNetMapDeprecatedMapping} + map: {get_attr: [ServiceNetMapValue, value]} |