mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
fix nxos_igmp issues (#38496)
This commit is contained in:
parent
dabe5e6d07
commit
361437b042
2 changed files with 37 additions and 9 deletions
|
@ -132,10 +132,12 @@ def main():
|
|||
commands.append('no ip igmp enforce-router-alert')
|
||||
|
||||
elif state == 'present':
|
||||
if desired['flush_routes'] and not current['flush_routes']:
|
||||
commands.append('ip igmp flush-routes')
|
||||
if desired['enforce_rtr_alert'] and not current['enforce_rtr_alert']:
|
||||
commands.append('ip igmp enforce-router-alert')
|
||||
ldict = {'flush_routes': 'flush-routes', 'enforce_rtr_alert': 'enforce-router-alert'}
|
||||
for arg in ['flush_routes', 'enforce_rtr_alert']:
|
||||
if desired[arg] and not current[arg]:
|
||||
commands.append('ip igmp {0}'.format(ldict.get(arg)))
|
||||
elif current[arg] and not desired[arg]:
|
||||
commands.append('no ip igmp {0}'.format(ldict.get(arg)))
|
||||
|
||||
result = {'changed': False, 'updates': commands, 'warnings': warnings}
|
||||
|
||||
|
@ -145,7 +147,8 @@ def main():
|
|||
result['changed'] = True
|
||||
|
||||
if module.params['restart']:
|
||||
run_commands(module, 'restart igmp')
|
||||
cmd = {'command': 'restart igmp', 'output': 'text'}
|
||||
run_commands(module, cmd)
|
||||
|
||||
module.exit_json(**result)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue