1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

loopback doesn't support passive_interface (#33252)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
Trishna Guha 2017-11-27 22:56:16 +05:30 committed by GitHub
parent b611c92626
commit 25a465ffcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -296,6 +296,8 @@ def state_present(module, existing, proposed, candidate):
if existing_commands[key] == proposed_commands[key]: if existing_commands[key] == proposed_commands[key]:
continue continue
if key == 'ip ospf passive-interface' and module.params.get('interface').upper().startswith('LO'):
module.fail_json(msg='loopback interface does not support passive_interface')
if value is True: if value is True:
commands.append(key) commands.append(key)
elif value is False: elif value is False:

View file

@ -50,3 +50,7 @@ class TestNxosInterfaceOspfModule(TestNxosModule):
def test_nxos_interface_ospf(self): def test_nxos_interface_ospf(self):
set_module_args(dict(interface='ethernet1/32', ospf=1, area=1)) set_module_args(dict(interface='ethernet1/32', ospf=1, area=1))
self.execute_module(changed=True, commands=['interface Ethernet1/32', 'ip router ospf 1 area 0.0.0.1']) self.execute_module(changed=True, commands=['interface Ethernet1/32', 'ip router ospf 1 area 0.0.0.1'])
def test_loopback_interface_failed(self):
set_module_args(dict(interface='loopback0', ospf=1, area=0, passive_interface=True))
self.execute_module(failed=True, changed=False)