2017-10-25 15:41:23 +00:00
|
|
|
---
|
2018-01-05 17:39:04 +00:00
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_igmp_interface sanity test"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-10-25 15:41:23 +00:00
|
|
|
|
|
|
|
# Select interface for test
|
|
|
|
- set_fact: intname="{{ nxos_int1 }}"
|
|
|
|
|
2018-04-23 15:08:49 +00:00
|
|
|
- set_fact: restart="true"
|
|
|
|
when: platform is not match("N35")
|
|
|
|
|
2017-10-25 15:41:23 +00:00
|
|
|
- name: "Enable feature PIM"
|
|
|
|
nxos_feature:
|
|
|
|
feature: pim
|
|
|
|
state: enabled
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2018-04-23 15:08:49 +00:00
|
|
|
- name: Put interface in default mode
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- "default interface {{ intname }}"
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
match: none
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2017-10-25 15:41:23 +00:00
|
|
|
- block:
|
|
|
|
|
|
|
|
- name: put interface in L3 and enable PIM
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- no switchport
|
|
|
|
- ip pim sparse-mode
|
|
|
|
parents:
|
|
|
|
- "interface {{ intname }}"
|
|
|
|
match: none
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
|
|
|
|
- name: Configure igmp interface with non-default values
|
|
|
|
nxos_igmp_interface: &non-default
|
|
|
|
interface: "{{ intname }}"
|
|
|
|
version: 3
|
|
|
|
startup_query_interval: 60
|
|
|
|
startup_query_count: 5
|
|
|
|
robustness: 6
|
|
|
|
querier_timeout: 2000
|
|
|
|
query_mrt: 12
|
|
|
|
query_interval: 200
|
|
|
|
last_member_qrt: 2
|
|
|
|
last_member_query_count: 4
|
|
|
|
report_llg: true
|
|
|
|
immediate_leave: true
|
2018-04-23 15:08:49 +00:00
|
|
|
group_timeout: 300
|
|
|
|
# deprecated
|
|
|
|
oif_prefix: 239.255.255.2
|
|
|
|
oif_source: 1.1.1.1
|
2017-10-25 15:41:23 +00:00
|
|
|
state: present
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: "Check Idempotence - Configure igmp interface with non-default values"
|
|
|
|
nxos_igmp_interface: *non-default
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2018-04-23 15:08:49 +00:00
|
|
|
- name: Configure igmp interface with some default values
|
|
|
|
nxos_igmp_interface: &sdef
|
|
|
|
interface: "{{ intname }}"
|
|
|
|
version: default
|
|
|
|
startup_query_interval: default
|
|
|
|
startup_query_count: default
|
|
|
|
robustness: default
|
|
|
|
querier_timeout: default
|
|
|
|
query_mrt: default
|
|
|
|
query_interval: default
|
|
|
|
last_member_qrt: default
|
|
|
|
last_member_query_count: default
|
|
|
|
group_timeout: default
|
|
|
|
oif_ps:
|
|
|
|
- {'prefix': '238.2.2.6'}
|
|
|
|
- {'prefix': '238.2.2.5'}
|
|
|
|
- {'source': '1.1.1.1', 'prefix': '238.2.2.5'}
|
|
|
|
state: present
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Check Idempotence - Configure igmp interface with some default values"
|
|
|
|
nxos_igmp_interface: *sdef
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: restart igmp
|
|
|
|
nxos_igmp_interface: &restart
|
|
|
|
interface: "{{ intname }}"
|
|
|
|
restart: "{{restart|default(omit)}}"
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
|
|
|
|
- name: Configure igmp interface with default oif_ps
|
|
|
|
nxos_igmp_interface: &defoif
|
|
|
|
interface: "{{ intname }}"
|
|
|
|
oif_ps: default
|
|
|
|
state: present
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Check Idempotence - Configure igmp interface with default oif_ps"
|
|
|
|
nxos_igmp_interface: *defoif
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: Configure igmp interface with oif_routemap
|
|
|
|
nxos_igmp_interface: &orm
|
|
|
|
interface: "{{ intname }}"
|
|
|
|
version: 3
|
|
|
|
startup_query_interval: 60
|
|
|
|
startup_query_count: 5
|
|
|
|
robustness: 6
|
|
|
|
oif_routemap: abcd
|
|
|
|
state: present
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Check Idempotence - Configure igmp interface with oif_routemap"
|
|
|
|
nxos_igmp_interface: *orm
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: Configure igmp interface with default state
|
2017-10-25 15:41:23 +00:00
|
|
|
nxos_igmp_interface: &default
|
|
|
|
interface: "{{ intname }}"
|
|
|
|
state: default
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
2018-04-23 15:08:49 +00:00
|
|
|
- name: "Check Idempotence - Configure igmp interface with default state"
|
2017-10-25 15:41:23 +00:00
|
|
|
nxos_igmp_interface: *default
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2018-04-23 15:08:49 +00:00
|
|
|
- name: Configure igmp interface with absent state
|
|
|
|
nxos_igmp_interface: &absent
|
|
|
|
interface: "{{ intname }}"
|
|
|
|
state: absent
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Check Idempotence - Configure igmp interface with absent state"
|
|
|
|
nxos_igmp_interface: *absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2017-10-25 15:41:23 +00:00
|
|
|
always:
|
2018-04-23 15:08:49 +00:00
|
|
|
- name: Configure igmp interface with absent state
|
|
|
|
nxos_igmp_interface: *absent
|
2017-10-25 15:41:23 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- name: Put interface in default mode
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- "default interface {{ intname }}"
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
match: none
|
|
|
|
|
|
|
|
- name: "Disable feature PIM"
|
|
|
|
nxos_feature:
|
|
|
|
feature: pim
|
|
|
|
state: disabled
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
|
2018-01-05 17:39:04 +00:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_igmp_interface sanity test"
|