Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nxos_igmp_snooping: more group-timeout fixes #53553

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/ansible/modules/network/nxos/nxos_igmp_snooping.py
Expand Up @@ -181,11 +181,12 @@ def config_igmp_snooping(delta, existing, default=False):

commands = []
command = None
gt_command = None
for key, value in delta.items():
if value:
if default and key == 'group_timeout':
if existing.get(key):
command = 'no ' + CMDS.get(key).format(existing.get(key))
gt_command = 'no ' + CMDS.get(key).format(existing.get(key))
elif value == 'default' and key == 'group_timeout':
if existing.get(key):
command = 'no ' + CMDS.get(key).format(existing.get(key))
Expand All @@ -198,6 +199,9 @@ def config_igmp_snooping(delta, existing, default=False):
commands.append(command)
command = None

if gt_command:
# ensure that group-timeout command is configured last
commands.append(gt_command)
return commands


Expand Down
Expand Up @@ -3,18 +3,23 @@
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"

- set_fact: gt_run="false"
- set_fact: gt_run="true"
when: not (platform is match("N5K")) and not (platform is match("N35"))
- meta: end_host
# show ip igmp snooping | json does not work on some platforms
when: platform is search('N6K')

- set_fact: group_timeout="never"
when: not (platform is match("N5K")) and not (platform is match("N35"))
- set_fact: gt_run="false"
- block:
- set_fact: gt_run="true"
- set_fact: group_timeout="never"
- set_fact: def_group_timeout="default"
when: platform is not search('N35|N5K|N6K')

- set_fact: def_group_timeout="default"
when: not (platform is match("N5K")) and not (platform is match("N35"))
- name: Setup
nxos_igmp_snooping: &default
provider: "{{ connection }}"
state: default

- block:

- name: Configure igmp snooping with non-default values
nxos_igmp_snooping: &non-default
snooping: false
Expand Down Expand Up @@ -90,9 +95,7 @@
when: gt_run or (imagetag and (imagetag is version_compare('D1', 'ne')))

- name: Configure igmp snooping with default values
nxos_igmp_snooping: &default
provider: "{{ connection }}"
state: default
nxos_igmp_snooping: *default
register: result

- assert: *true
Expand Down