From d89a1be011af497de232fc75d1a8a47121b9f762 Mon Sep 17 00:00:00 2001 From: linnil1 Date: Thu, 30 Aug 2018 20:40:58 +0800 Subject: [PATCH] Fix bug of interface-mode in Junos (#44380) * Fix bug of interface-mode in Junos * Fix typo. Thanks webknjaz. --- .../modules/network/junos/junos_l2_interface.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ansible/modules/network/junos/junos_l2_interface.py b/lib/ansible/modules/network/junos/junos_l2_interface.py index 1ad0a524ff..1bd5a2d1ae 100644 --- a/lib/ansible/modules/network/junos/junos_l2_interface.py +++ b/lib/ansible/modules/network/junos/junos_l2_interface.py @@ -48,6 +48,12 @@ options: description: - Native VLAN to be configured in trunk port. The value of C(native_vlan) should be vlan id. + enhanced_layer: + description: + - True if your device has Enhanced Layer 2 Software (ELS). + default: True + type: bool + version_added: "2.7" unit: description: - Logical interface number. Value of C(unit) should be of type @@ -172,6 +178,7 @@ def main(): trunk_vlans=dict(type='list'), unit=dict(default=0, type='int'), description=dict(), + enhanced_layer=dict(default=True, type='bool'), state=dict(default='present', choices=['present', 'absent']), active=dict(default=True, type='bool') ) @@ -235,6 +242,9 @@ def main(): validate_param_values(module, param_to_xpath_map, param=item) + param_to_xpath_map['mode']['xpath'] = \ + 'interface-mode' if param['enhanced_layer'] else 'port-mode' + want = map_params_to_obj(module, param_to_xpath_map, param=item) requests.append(map_obj_to_ele(module, want, top, param=item))