Remove stack_action for os-net-config

Since we're using ephemeral Heat, there is no UPDATE
stack action. All actions are now CREATE. Therefore,
we can no longer rely on the stack action to update
the network configuration and NetworkDeploymentActions
is no longer an option. This change adds a new parameter
tripleo_network_config_update. This will be a bool.

Change-Id: If53577a26edcb2dc67458603286471dfb87f0bda
This commit is contained in:
Brendan Shephard 2021-08-19 13:02:49 +00:00
parent dfe20f7c18
commit 306ceffaf5
7 changed files with 39 additions and 38 deletions

View File

@ -0,0 +1,12 @@
---
features:
- |
Introduce a new variable tripleo_network_config_update. This will be a
bool. When tripleo_network_config_update is True. Existing network
configurations will be updated. By default, this is False and only
new deployments will have the networks configured.
deprecations:
- |
This change removes the tripleo_network_config_action. Since we can no
longer rely on the Heat stack action when using Ephemeral Heat in
tripleo

View File

@ -52,11 +52,7 @@ _NETWORK_CONFIG_SCHEMA = {
'template': {'type': 'string'}, 'template': {'type': 'string'},
'physical_bridge_name': {'type': 'string'}, 'physical_bridge_name': {'type': 'string'},
'public_interface_name': {'type': 'string'}, 'public_interface_name': {'type': 'string'},
'network_deployment_actions': { 'network_config_update': {'type': 'boolean'},
'type': 'array',
'items': {'type': 'string',
'enum': ['CREATE', 'UPDATE']}
},
'net_config_data_lookup': {'type': 'object'}, 'net_config_data_lookup': {'type': 'object'},
'default_route_network': { 'default_route_network': {
'type': 'array', 'type': 'array',

View File

@ -85,12 +85,12 @@ options:
- Which interface to add to the public bridge - Which interface to add to the public bridge
type: string type: string
default: nic1 default: nic1
network_deployment_actions: network_config_update:
description: description:
- When to apply network configuration changes, allowed values - When to apply network configuration changes, allowed values
are CREATE and UPDATE. are True or False.
type: list type: boolean
default: ['CREATE'] default: False
networks_skip_config: networks_skip_config:
description: description:
- List of networks that should be skipped when configuring node - List of networks that should be skipped when configuring node
@ -123,7 +123,7 @@ Controller:
template: templates/multiple_nics/multiple_nics.j2 template: templates/multiple_nics/multiple_nics.j2
physical_bridge_name: br-ex physical_bridge_name: br-ex
public_interface_name: nic1 public_interface_name: nic1
network_deployment_actions: ['CREATE'] network_config_update: False
net_config_data_lookup: {} net_config_data_lookup: {}
bond_interface_ovs_options: bond_mode=balance-slb bond_interface_ovs_options: bond_mode=balance-slb
vars: vars:
@ -134,14 +134,14 @@ Compute:
template: templates/multiple_nics/multiple_nics.j2 template: templates/multiple_nics/multiple_nics.j2
physical_bridge_name: br-ex physical_bridge_name: br-ex
public_interface_name: nic1 public_interface_name: nic1
network_deployment_actions: ['CREATE'] network_config_update: False
net_config_data_lookup: {} net_config_data_lookup: {}
bond_interface_ovs_options: bond_mode=balance-slb bond_interface_ovs_options: bond_mode=balance-slb
overcloud-compute-1: overcloud-compute-1:
template: templates/multiple_nics/multiple_nics.j2 template: templates/multiple_nics/multiple_nics.j2
physical_bridge_name: br-ex physical_bridge_name: br-ex
public_interface_name: nic1 public_interface_name: nic1
network_deployment_actions: ['CREATE'] network_config_update: False
net_config_data_lookup: {} net_config_data_lookup: {}
bond_interface_ovs_options: bond_mode=balance-slb bond_interface_ovs_options: bond_mode=balance-slb
vars: vars:
@ -157,7 +157,7 @@ EXAMPLES = '''
template: templates/multiple_nics/multiple_nics.j2 template: templates/multiple_nics/multiple_nics.j2
physical_bridge_name: br-ex physical_bridge_name: br-ex
public_interface_name: nic1 public_interface_name: nic1
network_deployment_actions: ['CREATE'] network_config_update: False
net_config_data_lookup: {} net_config_data_lookup: {}
bond_interface_ovs_options: bond_mode=balance-slb bond_interface_ovs_options: bond_mode=balance-slb
- hostname: overcloud-novacompute-0 - hostname: overcloud-novacompute-0
@ -165,7 +165,7 @@ EXAMPLES = '''
template: templates/multiple_nics/multiple_nics.j2 template: templates/multiple_nics/multiple_nics.j2
physical_bridge_name: br-ex physical_bridge_name: br-ex
public_interface_name: nic1 public_interface_name: nic1
network_deployment_actions: ['CREATE'] network_config_update: False
net_config_data_lookup: {} net_config_data_lookup: {}
bond_interface_ovs_options: bond_mode=balance-slb bond_interface_ovs_options: bond_mode=balance-slb
- hostname: overcloud-novacompute-1 - hostname: overcloud-novacompute-1
@ -173,7 +173,7 @@ EXAMPLES = '''
template: templates/multiple_nics/multiple_nics.j2 template: templates/multiple_nics/multiple_nics.j2
physical_bridge_name: br-ex physical_bridge_name: br-ex
public_interface_name: nic1 public_interface_name: nic1
network_deployment_actions: ['CREATE'] network_config_update: False
net_config_data_lookup: {} net_config_data_lookup: {}
bond_interface_ovs_options: bond_mode=balance-slb bond_interface_ovs_options: bond_mode=balance-slb
hostname_role_map: hostname_role_map:
@ -196,8 +196,7 @@ def translate_opts_for_tripleo_network_config_role(network_config):
template='tripleo_network_config_template', template='tripleo_network_config_template',
physical_bridge_name='neutron_physical_bridge_name', physical_bridge_name='neutron_physical_bridge_name',
public_interface_name='neutron_public_interface_name', public_interface_name='neutron_public_interface_name',
network_deployment_actions=('tripleo_network_config_' network_config_update=('tripleo_network_config_update'),
'network_deployment_actions'),
net_config_data_lookup='tripleo_network_config_os_net_config_mappings', net_config_data_lookup='tripleo_network_config_os_net_config_mappings',
) )

View File

@ -31,14 +31,13 @@
roles: roles:
- role: tripleo_network_config - role: tripleo_network_config
vars: vars:
# The conditions in tripleo_network_config role for when we want to # The conditions here are when we want to apply the
# apply the NetworkConfig are: # NetworkConfig. They are:
# 1. If the stack_action is CREATE # - If tripleo_network_config_update is True
# 2. Or UPDATE is in the network_deployment_actions # - Or the previous run of NetworkConfig failed.
# 3. Or the previous run of NetworkConfig failed. # - Or it has never run
# 4. Or it has never run # This will match the prior behavior of when a Heat
# # SoftwareDeployment was used.
# Since we don't have stack_action in this case. Set the network # It also ensures the script does exist as a sine qua non
# config action to UPDATE here so that we only apply network # condition
# configuration if 2, 3 or 4 evalueates to TRUE. tripleo_network_config_update: True
tripleo_network_config_action: UPDATE

View File

@ -18,7 +18,7 @@
# All variables intended for modification should be placed in this file. # All variables intended for modification should be placed in this file.
# All variables within this role should have a prefix of "tripleo_network_config" # All variables within this role should have a prefix of "tripleo_network_config"
tripleo_network_config_action: CREATE tripleo_network_config_update: False
tripleo_network_config_async_poll: 3 tripleo_network_config_async_poll: 3
tripleo_network_config_async_timeout: 300 tripleo_network_config_async_timeout: 300
tripleo_network_config_bridge_name: br-ex tripleo_network_config_bridge_name: br-ex
@ -26,7 +26,6 @@ tripleo_network_config_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}"
tripleo_network_config_hide_sensitive_logs: true tripleo_network_config_hide_sensitive_logs: true
tripleo_network_config_interface_name: nic1 tripleo_network_config_interface_name: nic1
tripleo_network_config_manage_service: true tripleo_network_config_manage_service: true
tripleo_network_config_network_deployment_actions: []
tripleo_network_config_os_net_config_mappings: {} tripleo_network_config_os_net_config_mappings: {}
tripleo_network_config_safe_defaults: true tripleo_network_config_safe_defaults: true
tripleo_network_config_with_ansible: false tripleo_network_config_with_ansible: false

View File

@ -108,8 +108,7 @@
# The conditions here are when we want to apply the # The conditions here are when we want to apply the
# NetworkConfig. They are: # NetworkConfig. They are:
# - If the stack_action is CREATE # - If tripleo_network_config_update is True
# - Or UPDATE is in the network_deployment_actions
# - Or the previous run of NetworkConfig failed. # - Or the previous run of NetworkConfig failed.
# - Or it has never run # - Or it has never run
# This will match the prior behavior of when a Heat # This will match the prior behavior of when a Heat
@ -117,8 +116,7 @@
# It also ensures the script does exist as a sine qua non # It also ensures the script does exist as a sine qua non
# condition # condition
when: when:
- (tripleo_network_config_action == "CREATE") or - (tripleo_network_config_update) or
("UPDATE" in tripleo_network_config_network_deployment_actions) or
(os_net_config_returncode_stat.stat.exists and (os_net_config_returncode_stat.stat.exists and
((os_net_config_returncode_slurp.content | b64decode | int) != 0)) or ((os_net_config_returncode_slurp.content | b64decode | int) != 0)) or
(not os_net_config_returncode_stat.stat.exists) (not os_net_config_returncode_stat.stat.exists)

View File

@ -65,8 +65,7 @@ class TestTripleoGenerateInventoryNetworkConfig(tests_base.TestCase):
'networks_skip_config': [], 'networks_skip_config': [],
'neutron_physical_bridge_name': 'br-ex', 'neutron_physical_bridge_name': 'br-ex',
'neutron_public_interface_name': 'nic1', 'neutron_public_interface_name': 'nic1',
'tripleo_network_config_network_deployment_actions': 'tripleo_network_config_update': False,
['CREATE'],
'tripleo_network_config_os_net_config_mappings': {}, 'tripleo_network_config_os_net_config_mappings': {},
'tripleo_network_config_template': '/foo/template.j2'} 'tripleo_network_config_template': '/foo/template.j2'}
}, },
@ -81,8 +80,7 @@ class TestTripleoGenerateInventoryNetworkConfig(tests_base.TestCase):
'networks_skip_config': [], 'networks_skip_config': [],
'neutron_physical_bridge_name': 'br-ex', 'neutron_physical_bridge_name': 'br-ex',
'neutron_public_interface_name': 'nic1', 'neutron_public_interface_name': 'nic1',
'tripleo_network_config_network_deployment_actions': 'tripleo_network_config_update': False,
['CREATE'],
'tripleo_network_config_template': 'tripleo_network_config_template':
'templates/net_config_bridge.j2'}}, 'templates/net_config_bridge.j2'}},
'vars': { 'vars': {