Merge "Set dns_name propery on ports and networks"

This commit is contained in:
Zuul 2020-04-10 15:24:45 +00:00 committed by Gerrit Code Review
commit 13682a7f55
16 changed files with 89 additions and 20 deletions

View File

@ -9,6 +9,9 @@ parameters:
type: json type: json
name: name:
type: string type: string
dns_name:
default: ''
type: string
replacement_policy: replacement_policy:
type: string type: string
default: AUTO default: AUTO

View File

@ -21,6 +21,9 @@ parameters:
name: name:
default: '' default: ''
type: string type: string
dns_name:
default: ''
type: string
network: network:
default: '' default: ''
type: string type: string

View File

@ -153,7 +153,7 @@ parameter_defaults:
NeutronServicePlugins: router,segments NeutronServicePlugins: router,segments
NeutronMechanismDrivers: ['openvswitch', 'baremetal'] NeutronMechanismDrivers: ['openvswitch', 'baremetal']
NeutronNetworkVLANRanges: 'physnet1:1000:2999' NeutronNetworkVLANRanges: 'physnet1:1000:2999'
NeutronPluginExtensions: 'port_security' NeutronPluginExtensions: port_security,dns_domain_ports
NeutronFirewallDriver: '' NeutronFirewallDriver: ''
NeutronNetworkType: ['local','flat','vlan','gre','vxlan'] NeutronNetworkType: ['local','flat','vlan','gre','vxlan']
NeutronTunnelIdRanges: '20:100' NeutronTunnelIdRanges: '20:100'

View File

@ -18,6 +18,9 @@ import subprocess
CTLPLANE_NETWORK_NAME = 'ctlplane' CTLPLANE_NETWORK_NAME = 'ctlplane'
CONF = json.loads(os.environ['config']) CONF = json.loads(os.environ['config'])
CLOUD_DOMAIN = 'ctlplane.' + (CONF['cloud_domain'] + '.'
if not CONF['cloud_domain'].endswith('.')
else CONF['cloud_domain'])
def _run_command(args, env=None, name=None): def _run_command(args, env=None, name=None):
@ -57,13 +60,15 @@ def _ensure_neutron_network(sdk):
name=CTLPLANE_NETWORK_NAME, name=CTLPLANE_NETWORK_NAME,
provider_network_type='flat', provider_network_type='flat',
provider_physical_network=CONF['physical_network'], provider_physical_network=CONF['physical_network'],
mtu=CONF['mtu']) mtu=CONF['mtu'],
dns_domain=CLOUD_DOMAIN)
print('INFO: Network created %s' % network) print('INFO: Network created %s' % network)
else: else:
network = sdk.network.update_network( network = sdk.network.update_network(
network[0].id, network[0].id,
name=CTLPLANE_NETWORK_NAME, name=CTLPLANE_NETWORK_NAME,
mtu=CONF['mtu']) mtu=CONF['mtu'],
dns_domain=CLOUD_DOMAIN)
print('INFO: Network updated %s' % network) print('INFO: Network updated %s' % network)
except Exception: except Exception:
print('ERROR: Network create/update failed.') print('ERROR: Network create/update failed.')

View File

@ -87,6 +87,12 @@ parameters:
description: Mapping of service endpoint -> protocol. Typically set description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry. via parameter_defaults in the resource registry.
type: json type: json
CloudDomain:
default: 'localdomain'
type: string
description: >
The DNS domain used for the hosts. This must match the
overcloud_domain_name configured on the undercloud.
conditions: conditions:
@ -190,6 +196,7 @@ resources:
params: params:
JSON: JSON:
cloud_name: {get_param: UndercloudCloudName} cloud_name: {get_param: UndercloudCloudName}
cloud_domain: {get_param: CloudDomain}
local_ip: {get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]} local_ip: {get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]}
local_subnet: {get_param: UndercloudCtlplaneLocalSubnet} local_subnet: {get_param: UndercloudCtlplaneLocalSubnet}
physical_network: {get_param: CtlplaneLocalPhysicalNetwork} physical_network: {get_param: CtlplaneLocalPhysicalNetwork}

View File

@ -137,6 +137,12 @@ parameters:
needed. Defaults to true. For multi-stack use cases where the network needed. Defaults to true. For multi-stack use cases where the network
related resources have already been managed by a separate stack, this related resources have already been managed by a separate stack, this
parameter can be set to false. parameter can be set to false.
CloudDomain:
default: 'localdomain'
type: string
description: >
The DNS domain used for the hosts. This must match the
overcloud_domain_name configured on the undercloud.
conditions: conditions:
manage_networks: {get_param: ManageNetworks} manage_networks: {get_param: ManageNetworks}
@ -151,6 +157,12 @@ resources:
properties: properties:
admin_state_up: {get_param: {{network.name}}NetAdminStateUp} admin_state_up: {get_param: {{network.name}}NetAdminStateUp}
name: {get_param: {{network.name}}NetName} name: {get_param: {{network.name}}NetName}
dns_domain:
list_join:
- '.'
- - {{network.name.lower()}}
- {get_param: CloudDomain}
- ''
shared: {get_param: {{network.name}}NetShared} shared: {get_param: {{network.name}}NetShared}
value_specs: value_specs:
map_merge: map_merge:

View File

@ -17,6 +17,10 @@ parameters:
description: Name of the port description: Name of the port
default: '' default: ''
type: string type: string
DnsName:
description: DNS name of the port
default: ''
type: string
ControlPlaneIP: # Here for compatibility with noop.yaml ControlPlaneIP: # Here for compatibility with noop.yaml
description: IP address on the control plane description: IP address on the control plane
default: '' default: ''
@ -56,6 +60,7 @@ resources:
properties: properties:
network: {get_param: ControlPlaneNetwork} network: {get_param: ControlPlaneNetwork}
name: {get_param: PortName} name: {get_param: PortName}
dns_name: {get_param: DnsName}
fixed_ips: fixed_ips:
if: if:
- fixed_ip_not_set - fixed_ip_not_set

View File

@ -16,6 +16,10 @@ parameters:
description: Name of the port description: Name of the port
default: '' default: ''
type: string type: string
DnsName:
description: DNS name of the port
default: ''
type: string
ControlPlaneIP: # Here for compatibility with ctlplane_vip.yaml ControlPlaneIP: # Here for compatibility with ctlplane_vip.yaml
description: IP address on the control plane description: IP address on the control plane
default: '' default: ''

View File

@ -16,6 +16,10 @@ parameters:
description: Name of the port description: Name of the port
default: '' default: ''
type: string type: string
DnsName:
description: DNS name of the port
default: ''
type: string
ControlPlaneIP: # Here for compatability with ctlplane_vip.yaml ControlPlaneIP: # Here for compatability with ctlplane_vip.yaml
description: IP address on the control plane description: IP address on the control plane
default: '' default: ''

View File

@ -29,6 +29,10 @@ parameters:
description: Name of the port description: Name of the port
default: '' default: ''
type: string type: string
DnsName:
description: DNS name of the port
default: ''
type: string
NetworkName: # Here for compatibility with vip.yaml NetworkName: # Here for compatibility with vip.yaml
description: Name of the network where the VIP will be created description: Name of the network where the VIP will be created
default: ctlplane default: ctlplane

View File

@ -13,6 +13,10 @@ parameters:
description: Name of the port description: Name of the port
default: '' default: ''
type: string type: string
DnsName:
description: DNS name of the port
default: ''
type: string
ControlPlaneIP: # Here for compatibility with noop.yaml ControlPlaneIP: # Here for compatibility with noop.yaml
description: IP address on the control plane description: IP address on the control plane
default: '' default: ''
@ -70,6 +74,7 @@ resources:
properties: properties:
network: {get_param: {{network.name}}NetName} network: {get_param: {{network.name}}NetName}
name: {get_param: PortName} name: {get_param: PortName}
dns_name: {get_param: DnsName}
fixed_ips: fixed_ips:
if: if:
- net_is_ctlplane_and_fixed_ip_not_set - net_is_ctlplane_and_fixed_ip_not_set

View File

@ -18,6 +18,10 @@ parameters:
description: Name of the port description: Name of the port
default: '' default: ''
type: string type: string
DnsName:
description: DNS name of the port
default: ''
type: string
FixedIPs: FixedIPs:
description: > description: >
Control the IP allocation for the VIP port. E.g. Control the IP allocation for the VIP port. E.g.

View File

@ -17,6 +17,10 @@ parameters:
description: Name of the port description: Name of the port
default: '' default: ''
type: string type: string
DnsName:
description: DNS name of the port
default: ''
type: string
ControlPlaneIP: # Here for compatibility with noop.yaml ControlPlaneIP: # Here for compatibility with noop.yaml
description: IP address on the control plane description: IP address on the control plane
default: '' default: ''

View File

@ -17,6 +17,10 @@ parameters:
description: Name of the port description: Name of the port
default: '' default: ''
type: string type: string
DnsName:
description: DNS name of the port
default: ''
type: string
ControlPlaneIP: # Here for compatability with noop.yaml ControlPlaneIP: # Here for compatability with noop.yaml
description: IP address on the control plane description: IP address on the control plane
default: '' default: ''

View File

@ -922,6 +922,7 @@ resources:
type: OS::TripleO::Network::Ports::ControlPlaneVipPort type: OS::TripleO::Network::Ports::ControlPlaneVipPort
properties: properties:
name: control_virtual_ip name: control_virtual_ip
dns_name: {str_split: ['.', {get_param: CloudNameCtlplane}, 0]}
network: {get_param: NeutronControlPlaneID} network: {get_param: NeutronControlPlaneID}
fixed_ips: fixed_ips:
if: if:
@ -942,6 +943,7 @@ resources:
- {str_split: ['/', {get_attr: [ControlVirtualIP, subnets, 0, cidr]}, 1]} - {str_split: ['/', {get_attr: [ControlVirtualIP, subnets, 0, cidr]}, 1]}
ControlPlaneNetwork: {get_param: NeutronControlPlaneID} ControlPlaneNetwork: {get_param: NeutronControlPlaneID}
PortName: redis_virtual_ip PortName: redis_virtual_ip
DnsName: null
NetworkName: {get_attr: [ServiceNetMap, service_net_map, RedisNetwork]} NetworkName: {get_attr: [ServiceNetMap, service_net_map, RedisNetwork]}
ServiceName: redis ServiceName: redis
FixedIPs: FixedIPs:
@ -962,6 +964,7 @@ resources:
- {str_split: ['/', {get_attr: [ControlVirtualIP, subnets, 0, cidr]}, 1]} - {str_split: ['/', {get_attr: [ControlVirtualIP, subnets, 0, cidr]}, 1]}
ControlPlaneNetwork: {get_param: NeutronControlPlaneID} ControlPlaneNetwork: {get_param: NeutronControlPlaneID}
PortName: ovn_dbs_virtual_ip PortName: ovn_dbs_virtual_ip
DnsName: null
NetworkName: {get_attr: [ServiceNetMap, service_net_map, OvnDbsNetwork]} NetworkName: {get_attr: [ServiceNetMap, service_net_map, OvnDbsNetwork]}
ServiceName: ovn_dbs ServiceName: ovn_dbs
FixedIPs: FixedIPs:
@ -974,24 +977,9 @@ resources:
{%- if network.name == 'External' %} {%- if network.name == 'External' %}
# The public VIP is on the External net, falls back to ctlplane # The public VIP is on the External net, falls back to ctlplane
PublicVirtualIP: PublicVirtualIP:
depends_on: [Networks, ServiceNetMap]
type: OS::TripleO::Network::Ports::ExternalVipPort
properties:
ControlPlaneIP: {get_attr: [ControlVirtualIP, fixed_ips, 0, ip_address]}
ControlPlaneSubnetCidr:
if:
- ctlplane_subnet_cidr_set
- {get_param: ControlPlaneSubnetCidr}
- {str_split: ['/', {get_attr: [ControlVirtualIP, subnets, 0, cidr]}, 1]}
ControlPlaneNetwork: {get_param: NeutronControlPlaneID}
PortName: public_virtual_ip
FixedIPs:
if:
- public_virtual_fixed_ip_set
- {get_param: PublicVirtualFixedIPs}
- [{subnet: {get_attr: [ServiceNetMap, vip_subnet_map, {{network.name}}]}}]
{%- else %} {%- else %}
{{network.name}}VirtualIP: {{network.name}}VirtualIP:
{%- endif %}
depends_on: [Networks, ServiceNetMap] depends_on: [Networks, ServiceNetMap]
type: OS::TripleO::Network::Ports::{{network.name}}VipPort type: OS::TripleO::Network::Ports::{{network.name}}VipPort
properties: properties:
@ -1001,13 +989,29 @@ resources:
- ctlplane_subnet_cidr_set - ctlplane_subnet_cidr_set
- {get_param: ControlPlaneSubnetCidr} - {get_param: ControlPlaneSubnetCidr}
- {str_split: ['/', {get_attr: [ControlVirtualIP, subnets, 0, cidr]}, 1]} - {str_split: ['/', {get_attr: [ControlVirtualIP, subnets, 0, cidr]}, 1]}
{%- if network.name == 'External' %}
PortName: public_virtual_ip
DnsName: {str_split: ['.', {get_param: CloudName}, 0]}
{%- else %}
PortName: {{network.name_lower}}_virtual_ip PortName: {{network.name_lower}}_virtual_ip
{%- endif %}
{%- if network.name == 'InternalApi' %}
DnsName: {str_split: ['.', {get_param: CloudNameInternal}, 0]}
{%- elif network.name == 'StorageMgmt' %}
DnsName: {str_split: ['.', {get_param: CloudNameStorageManagement}, 0]}
{%- elif network.name not in ['External', 'InternalApi', 'StorageMgmt'] %}
DnsName: {str_split: ['.', {get_param: CloudName{{network.name}}}, 0]}
{%- endif %}
FixedIPs: FixedIPs:
if: if:
{%- if network.name == 'External' %}
- public_virtual_fixed_ip_set
- {get_param: PublicVirtualFixedIPs}
{%- else %}
- {{network.name_lower}}_virtual_fixed_ip_set - {{network.name_lower}}_virtual_fixed_ip_set
- {get_param: {{network.name}}VirtualFixedIPs} - {get_param: {{network.name}}VirtualFixedIPs}
{%- endif %}
- [{subnet: {get_attr: [ServiceNetMap, vip_subnet_map, {{network.name}}]}}] - [{subnet: {get_attr: [ServiceNetMap, vip_subnet_map, {{network.name}}]}}]
{% endif %}
{%- endfor %} {%- endfor %}
VipMap: VipMap:

View File

@ -374,6 +374,7 @@ resources:
- '_' - '_'
- - {get_attr: [{{server_resource_name}}, name]} - - {get_attr: [{{server_resource_name}}, name]}
- {{network.name}} - {{network.name}}
DnsName: {get_attr: [{{server_resource_name}}, name]}
ControlPlaneIP: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]} ControlPlaneIP: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
FixedIPs: FixedIPs:
if: if: