Add 'role_tags' to network_config schema

Some of the network config templates shipped with tripleo-ansible
uses the `role_tags` in jinja2. For example:
  roles/tripleo_network_config/templates/multiple_nics/multiple_nics.j2

 elif network in role_networks or 'external_bridge' in role_tags

This change add's 'role_tags' to the network_config schema for
baremeteal deployment definition.

Closes-Bug: #2039008
Change-Id: I15e7e03c40d9334a665f7063df90bcddcccabfd4
This commit is contained in:
Harald Jensås
2023-10-11 09:22:21 +02:00
parent 2689312707
commit 718dc67661
3 changed files with 13 additions and 1 deletions

View File

@@ -65,7 +65,11 @@ _NETWORK_CONFIG_SCHEMA = {
},
'dns_search_domains': {'type': 'string'},
'bond_interface_ovs_options': {'type': 'string'},
'num_dpdk_interface_rx_queues': {'type': 'integer'}
'num_dpdk_interface_rx_queues': {'type': 'integer'},
'role_tags': {
'type': 'array',
'items': {'type': 'string'}
}
},
'additionalProperties': False
}

View File

@@ -113,6 +113,12 @@ options:
- Number of Rx Queues required for DPDK bond or DPDK ports
type: int
default: 1
role_tags:
description:
- Role tags used in jinja2 NIC config templates. For example
the tag 'external_bridge' is used in multiple NIC's templates.
type: list
default: []
hostname_role_map:
description:
- Mapping of instance hostnames to role name

View File

@@ -66,6 +66,7 @@ class TestTripleoGenerateInventoryNetworkConfig(tests_base.TestCase):
'neutron_physical_bridge_name': 'br-ex',
'neutron_public_interface_name': 'nic1',
'num_dpdk_interface_rx_queues': 1,
'role_tags': [],
'tripleo_network_config_update': False,
'tripleo_network_config_os_net_config_mappings': {},
'tripleo_network_config_template': '/foo/template.j2'}
@@ -83,6 +84,7 @@ class TestTripleoGenerateInventoryNetworkConfig(tests_base.TestCase):
'neutron_physical_bridge_name': 'br-ex',
'neutron_public_interface_name': 'nic1',
'num_dpdk_interface_rx_queues': 1,
'role_tags': [],
'tripleo_network_config_update': False,
'tripleo_network_config_template':
'templates/net_config_bridge.j2'}},