From f49555d4941e40c1702526188d02470d7d315ebe Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Mon, 13 Nov 2017 14:48:31 +0000 Subject: [PATCH] nxos_bgp_neighbor_af feature idea disable-peer-as-check (#32665) * nxos_bgp_neighbor_af feature idea disable-peer-as-check Signed-off-by: Trishna Guha * Add unit test Signed-off-by: Trishna Guha --- lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py | 9 +++++++++ .../modules/network/nxos/test_nxos_bgp_neighbor_af.py | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py b/lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py index 11e1459462a..d819cb23846 100644 --- a/lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py +++ b/lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py @@ -136,6 +136,12 @@ options: or 'default'. required: false default: null + disable_peer_as_check: + description: + - Disable checking of peer AS-number while advertising + required: false + choices: ['true', 'false'] + version_added: 2.5 filter_list_in: description: - Valid values are a string defining a filter-list name, @@ -294,6 +300,7 @@ BOOL_PARAMS = [ 'allowas_in', 'as_override', 'default_originate', + 'disable_peer_as_check', 'next_hop_self', 'next_hop_third_party', 'route_reflector_client', @@ -312,6 +319,7 @@ PARAM_TO_COMMAND_KEYMAP = { 'as_override': 'as-override', 'default_originate': 'default-originate', 'default_originate_route_map': 'default-originate route-map', + 'disable_peer_as_check': 'disable-peer-as-check', 'filter_list_in': 'filter-list in', 'filter_list_out': 'filter-list out', 'max_prefix_limit': 'maximum-prefix', @@ -637,6 +645,7 @@ def main(): as_override=dict(required=False, type='bool'), default_originate=dict(required=False, type='bool'), default_originate_route_map=dict(required=False, type='str'), + disable_peer_as_check=dict(required=False, type='bool'), filter_list_in=dict(required=False, type='str'), filter_list_out=dict(required=False, type='str'), max_prefix_limit=dict(required=False, type='str'), diff --git a/test/units/modules/network/nxos/test_nxos_bgp_neighbor_af.py b/test/units/modules/network/nxos/test_nxos_bgp_neighbor_af.py index 088e0df2ffb..bbaf1e4f14e 100644 --- a/test/units/modules/network/nxos/test_nxos_bgp_neighbor_af.py +++ b/test/units/modules/network/nxos/test_nxos_bgp_neighbor_af.py @@ -97,3 +97,11 @@ class TestNxosBgpNeighborAfModule(TestNxosModule): changed=True, sort=False, commands=['router bgp 65535', 'neighbor 3.3.3.5', 'address-family ipv4 unicast', 'maximum-prefix 20 20'] ) + + def test_nxos_bgp_neighbor_af_disable_peer_as_check(self): + set_module_args(dict(asn=65535, neighbor='3.3.3.5', afi='ipv4', + safi='unicast', disable_peer_as_check=True)) + self.execute_module( + changed=True, + commands=['router bgp 65535', 'neighbor 3.3.3.5', 'address-family ipv4 unicast', 'disable-peer-as-check'] + )