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
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.
# Type: number
SwiftReplicas: 1

View File

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

View File

@ -92,6 +92,9 @@ parameters:
description: |
Additional hiera configuration to inject into the cluster.
type: json
DeployedServerPortMap:
default: {}
type: json
NeutronControlPlaneID:
default: 'ctlplane'
type: string
@ -114,6 +117,14 @@ parameters:
The subnet CIDR of the control plane network. (The parameter is
automatically resolved from the ctlplane subnet's cidr attribute.)
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:
default: []
description: >
@ -193,6 +204,20 @@ parameters:
# Jinja loop for Role in role_data.yaml
{% 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:
default: {}
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]}
{%- endif %}
{%- endfor %}
dns_search_domains: {get_param: DnsSearchDomains}
local_mtu: {get_param: {{role.name}}LocalMtu}
role_networks:
{%- for network in networks if network.enabled|default(true) and network.name in role.networks|default([]) %}
- {{network.name}}
{%- endfor %}
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 %}
@ -1247,6 +1276,7 @@ outputs:
neutron_public_interface_name: {get_param: NeutronPublicInterface}
network_deployment_actions: {get_attr: [{{role.name}}NetworkDeploymentActionsValue, value]}
tripleo_network_config_os_net_config_mappings: {get_param: NetConfigDataLookup}
deployed_server_port_map: {get_param: DeployedServerPortMap}
- {get_param: {{role.name}}ExtraGroupVars}
{%- endfor %}
RoleNetHostnameMap:

View File

@ -577,13 +577,6 @@ resources:
properties:
type: json
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 %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name_lower}}_cidr: {get_attr: [{{network.name}}Port, cidr]}

View File

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