From a62ad6b0d33f7c35231425c9de34b0469b1f91be Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 8 Sep 2017 16:18:39 +0000 Subject: [PATCH] Allow switch ports to be excluded from NGS trunk port list Currently we use the switch interface descriptions in the switch_interface_config variable with the kolla_neutron_ml2_generic_switch_trunk_port_hosts variable to generate a list of ports for each switch that should be added as trunk ports to all networks. This change allows switch interfaces to be given an 'ngs_trunk_port' boolean field which can be used to exclude matching interfaces from the list. This may be useful in cases where a host has multiple interfaces but only some should be added as trunk ports. --- ansible/filter_plugins/switches.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/filter_plugins/switches.py b/ansible/filter_plugins/switches.py index 1f64f5cba..78fbd1665 100644 --- a/ansible/filter_plugins/switches.py +++ b/ansible/filter_plugins/switches.py @@ -27,7 +27,8 @@ def switch_interface_config_select_description(switch_interface_config, descript return { name: config for name, config in switch_interface_config.items() - if config.get('description') in descriptions + if (config.get('description') in descriptions and + config.get('ngs_trunk_port', True)) }