2017-10-25 17:41:23 +02:00
|
|
|
---
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_igmp_snooping sanity test"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-10-25 17:41:23 +02:00
|
|
|
|
2018-04-11 16:14:27 +02:00
|
|
|
- set_fact: gt_run="false"
|
|
|
|
- set_fact: gt_run="true"
|
|
|
|
when: not (platform is match("N5K")) and not (platform is match("N35"))
|
|
|
|
|
|
|
|
- set_fact: group_timeout="never"
|
|
|
|
when: not (platform is match("N5K")) and not (platform is match("N35"))
|
|
|
|
|
|
|
|
- set_fact: def_group_timeout="default"
|
|
|
|
when: not (platform is match("N5K")) and not (platform is match("N35"))
|
|
|
|
|
2017-10-25 17:41:23 +02:00
|
|
|
- block:
|
|
|
|
|
|
|
|
- name: Configure igmp snooping with non-default values
|
|
|
|
nxos_igmp_snooping: &non-default
|
2018-04-11 16:14:27 +02:00
|
|
|
snooping: false
|
|
|
|
group_timeout: "{{group_timeout|default(omit)}}"
|
|
|
|
link_local_grp_supp: false
|
|
|
|
report_supp: false
|
2017-10-25 17:41:23 +02:00
|
|
|
v3_report_supp: true
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-10-25 17:41:23 +02:00
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2018-04-11 16:14:27 +02:00
|
|
|
- block:
|
|
|
|
- name: "Check Idempotence - Configure igmp snooping with non-default values"
|
|
|
|
nxos_igmp_snooping: *non-default
|
|
|
|
register: result
|
2017-10-25 17:41:23 +02:00
|
|
|
|
2018-04-11 16:14:27 +02:00
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
when: (imagetag and (imagetag is version_compare('D1', 'ne')))
|
|
|
|
|
|
|
|
- name: Configure igmp snooping with default group timeout
|
|
|
|
nxos_igmp_snooping: &defgt
|
|
|
|
group_timeout: "{{def_group_timeout|default(omit)}}"
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-04-11 16:14:27 +02:00
|
|
|
state: present
|
2017-10-25 17:41:23 +02:00
|
|
|
register: result
|
|
|
|
|
2018-04-11 16:14:27 +02:00
|
|
|
- assert: *true
|
|
|
|
when: gt_run
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_igmp_snooping: *defgt
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
when: gt_run or (imagetag and (imagetag is version_compare('D1', 'ne')))
|
2017-10-25 17:41:23 +02:00
|
|
|
|
|
|
|
- name: Configure igmp snooping with default values
|
|
|
|
nxos_igmp_snooping: &default
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-10-25 17:41:23 +02:00
|
|
|
state: default
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
2018-04-11 16:14:27 +02:00
|
|
|
- block:
|
|
|
|
- name: "Check Idempotence - Configure igmp snooping with default values"
|
|
|
|
nxos_igmp_snooping: *default
|
|
|
|
register: result
|
2017-10-25 17:41:23 +02:00
|
|
|
|
2018-04-11 16:14:27 +02:00
|
|
|
- assert: *false
|
|
|
|
when: (imagetag and (imagetag is version_compare('D1', 'ne')))
|
2017-10-25 17:41:23 +02:00
|
|
|
|
|
|
|
always:
|
|
|
|
- name: Configure igmp snooping with default values
|
|
|
|
nxos_igmp_snooping: *default
|
|
|
|
register: result
|
|
|
|
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_igmp_snooping sanity test"
|