Use ansible for undercloud/standalone network config

This patch changes undercloud and standalone roles to
generate network config with only ansible and
not depend on downloaded network config from
heat stack.

Depends-On: https://review.opendev.org/#/c/753958/
Change-Id: Ibcb0f0a65cfd04d677a4b861d9f647af13611b24
This commit is contained in:
Rabi Mishra 2020-09-16 12:39:08 +05:30
parent 7b8c6b07da
commit 02f80c05d0
5 changed files with 55 additions and 7 deletions

View File

@ -52,6 +52,14 @@ parameter_defaults:
# Type: boolean # Type: boolean
SshFirewallAllowAll: True SshFirewallAllowAll: True
# Standalone NetworkConfigTemplate
# Type: string
StandaloneNetworkConfigTemplate: ''
# Standalone NetworkConfig with ansible flag
# Type: boolean
StandaloneNetworkConfigWithAnsible: False
# How many replicas to use in the swift rings. # How many replicas to use in the swift rings.
# Type: number # Type: number
SwiftReplicas: 1 SwiftReplicas: 1

View File

@ -181,6 +181,8 @@ parameter_defaults:
# - {'destination': '10.10.10.0/24', 'nexthop': '192.168.24.254'} # - {'destination': '10.10.10.0/24', 'nexthop': '192.168.24.254'}
UndercloudCtlplaneSubnets: {} UndercloudCtlplaneSubnets: {}
UndercloudCtlplaneLocalSubnet: 'ctlplane-subnet' UndercloudCtlplaneLocalSubnet: 'ctlplane-subnet'
UndercloudNetworkConfigTemplate: 'templates/undercloud.j2'
UndercloudNetworkConfigWithAnsible: true
MistralDockerGroup: true MistralDockerGroup: true
PasswordAuthentication: 'yes' PasswordAuthentication: 'yes'
HeatEngineOptVolumes: HeatEngineOptVolumes:

View File

@ -92,6 +92,9 @@ parameters:
description: | description: |
Additional hiera configuration to inject into the cluster. Additional hiera configuration to inject into the cluster.
type: json type: json
DeployedServerPortMap:
default: {}
type: json
NeutronControlPlaneID: NeutronControlPlaneID:
default: 'ctlplane' default: 'ctlplane'
type: string type: string
@ -114,6 +117,14 @@ parameters:
The subnet CIDR of the control plane network. (The parameter is The subnet CIDR of the control plane network. (The parameter is
automatically resolved from the ctlplane subnet's cidr attribute.) automatically resolved from the ctlplane subnet's cidr attribute.)
type: string type: string
DnsSearchDomains: # Override this via parameter_defaults
default: []
description: A list of DNS search domains to be added (in order) to resolv.conf.
type: comma_delimited_list
NeutronPublicInterface:
default: nic1
description: Which interface to add to the NeutronPhysicalBridge.
type: string
ControlFixedIPs: ControlFixedIPs:
default: [] default: []
description: > description: >
@ -193,6 +204,20 @@ parameters:
# Jinja loop for Role in role_data.yaml # Jinja loop for Role in role_data.yaml
{% for role in roles %} {% for role in roles %}
{{role.name}}LocalMtu: # Override this via parameter_defaults
default: 1500
description: MTU to use for the Undercloud local_interface.
type: number
constraints:
- range: { min: 1000, max: 65536 }
{{role.name}}NetworkConfigTemplate:
description: {{role.name}} NetworkConfig Template
type: string
default: ''
{{role.name}}NetworkConfigWithAnsible:
description: {{role.name}} NetworkConfig with ansible flag
type: boolean
default: False
{{role.name}}ExtraConfig: {{role.name}}ExtraConfig:
default: {} default: {}
description: | description: |
@ -950,11 +975,15 @@ resources:
{{network.name}}_cidr: {str_split: ['/', {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{network.name_lower}}_subnet, cidr]}, 1]} {{network.name}}_cidr: {str_split: ['/', {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{network.name_lower}}_subnet, cidr]}, 1]}
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
dns_search_domains: {get_param: DnsSearchDomains}
local_mtu: {get_param: {{role.name}}LocalMtu}
role_networks: role_networks:
{%- for network in networks if network.enabled|default(true) and network.name in role.networks|default([]) %} {%- for network in networks if network.enabled|default(true) and network.name in role.networks|default([]) %}
- {{network.name}} - {{network.name}}
{%- endfor %} {%- endfor %}
service_metadata_settings: {get_attr: [{{role.name}}ServiceChainRoleData, value, service_metadata_settings]} service_metadata_settings: {get_attr: [{{role.name}}ServiceChainRoleData, value, service_metadata_settings]}
tripleo_network_config_template: {get_param: {{role.name}}NetworkConfigTemplate}
tripleo_network_config_with_ansible: {get_param: {{role.name}}NetworkConfigWithAnsible}
{% endfor %} {% endfor %}
@ -1247,6 +1276,7 @@ outputs:
neutron_public_interface_name: {get_param: NeutronPublicInterface} neutron_public_interface_name: {get_param: NeutronPublicInterface}
network_deployment_actions: {get_attr: [{{role.name}}NetworkDeploymentActionsValue, value]} network_deployment_actions: {get_attr: [{{role.name}}NetworkDeploymentActionsValue, value]}
tripleo_network_config_os_net_config_mappings: {get_param: NetConfigDataLookup} tripleo_network_config_os_net_config_mappings: {get_param: NetConfigDataLookup}
deployed_server_port_map: {get_param: DeployedServerPortMap}
- {get_param: {{role.name}}ExtraGroupVars} - {get_param: {{role.name}}ExtraGroupVars}
{%- endfor %} {%- endfor %}
RoleNetHostnameMap: RoleNetHostnameMap:

View File

@ -577,13 +577,6 @@ resources:
properties: properties:
type: json type: json
value: value:
ctlplane_subnet_cidr:
if:
- ctlplane_subnet_cidr_set
- {get_param: ControlPlaneSubnetCidr}
- yaql:
expression: str("{0}".format($.data).split("/")[-1])
data: {get_attr: [{{server_resource_name}}, addresses, ctlplane, 0, subnets, 0, cidr]}
{%- for network in networks %} {%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %} {%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name_lower}}_cidr: {get_attr: [{{network.name}}Port, cidr]} {{network.name_lower}}_cidr: {get_attr: [{{network.name}}Port, cidr]}

View File

@ -47,12 +47,19 @@ environments:
parameters: parameters:
- AddVipsToEtcHosts - AddVipsToEtcHosts
- NetworkSafeDefaults - NetworkSafeDefaults
- StandaloneNetworkConfigWithAnsible
- StandaloneNetworkConfigTemplate
sample_values: sample_values:
StackAction: CREATE StackAction: CREATE
SoftwareConfigTransport: POLL_SERVER_HEAT SoftwareConfigTransport: POLL_SERVER_HEAT
EnablePackageInstall: true EnablePackageInstall: true
SwiftReplicas: 1 SwiftReplicas: 1
SshFirewallAllowAll: true SshFirewallAllowAll: true
StandaloneNetworkConfigWithAnsible: false
StandaloneNetworkConfigTemplate: ''
resource_registry: resource_registry:
# this network config is assumed by the tripleo deploy command # this network config is assumed by the tripleo deploy command
OS::TripleO::Network::Ports::RedisVipPort: ../../network/ports/noop.yaml OS::TripleO::Network::Ports::RedisVipPort: ../../network/ports/noop.yaml
@ -285,3 +292,11 @@ parameters:
default: true default: true
description: Allow to enable/disable safe networking defaults if os-net-config would fail to run with the provided config. description: Allow to enable/disable safe networking defaults if os-net-config would fail to run with the provided config.
type: boolean type: boolean
StandaloneNetworkConfigTemplate:
description: Standalone NetworkConfigTemplate
type: string
default: ''
StandaloneNetworkConfigWithAnsible:
description: Standalone NetworkConfig with ansible flag
type: boolean
default: False