2017-10-25 17:41:23 +02:00
|
|
|
---
|
2018-01-05 18:39:04 +01: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 17:41:23 +02:00
|
|
|
|
|
|
|
# Select interface for test
|
|
|
|
- set_fact: intname="{{ nxos_int1 }}"
|
|
|
|
|
2018-04-23 17:08:49 +02:00
|
|
|
- set_fact: restart="true"
|
|
|
|
when: platform is not match("N35")
|
|
|
|
|
2017-10-25 17:41:23 +02:00
|
|
|
- name: "Enable feature PIM"
|
|
|
|
nxos_feature:
|
|
|
|
feature: pim
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-10-25 17:41:23 +02:00
|
|
|
state: enabled
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2018-04-23 17:08:49 +02:00
|
|
|
- name: Put interface in default mode
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- "default interface {{ intname }}"
|
|
|
|
match: none
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-04-23 17:08:49 +02:00
|
|
|
ignore_errors: yes
|
|
|
|
|
2017-10-25 17:41:23 +02:00
|
|
|
- block:
|
|
|
|
|
|
|
|
- name: put interface in L3 and enable PIM
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- no switchport
|
|
|
|
- ip pim sparse-mode
|
|
|
|
parents:
|
|
|
|
- "interface {{ intname }}"
|
|
|
|
match: none
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-10-25 17:41:23 +02:00
|
|
|
|
|
|
|
- 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 17:08:49 +02:00
|
|
|
group_timeout: 300
|
|
|
|
# deprecated
|
|
|
|
oif_prefix: 239.255.255.2
|
2018-05-30 19:03:20 +02:00
|
|
|
oif_source: 192.0.2.1
|
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"
|
|
|
|
|
|
|
|
- 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 17:08:49 +02: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'}
|
2018-05-30 19:03:20 +02:00
|
|
|
- {'source': '192.0.2.1', 'prefix': '238.2.2.5'}
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-04-23 17:08:49 +02:00
|
|
|
state: present
|
|
|
|
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)}}"
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-04-23 17:08:49 +02:00
|
|
|
|
|
|
|
- name: Configure igmp interface with default oif_ps
|
|
|
|
nxos_igmp_interface: &defoif
|
|
|
|
interface: "{{ intname }}"
|
|
|
|
oif_ps: default
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-04-23 17:08:49 +02:00
|
|
|
state: present
|
|
|
|
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
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-04-23 17:08:49 +02:00
|
|
|
state: present
|
|
|
|
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 17:41:23 +02:00
|
|
|
nxos_igmp_interface: &default
|
|
|
|
interface: "{{ intname }}"
|
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-23 17:08:49 +02:00
|
|
|
- name: "Check Idempotence - Configure igmp interface with default state"
|
2017-10-25 17:41:23 +02:00
|
|
|
nxos_igmp_interface: *default
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2018-04-23 17:08:49 +02:00
|
|
|
- name: Configure igmp interface with absent state
|
|
|
|
nxos_igmp_interface: &absent
|
|
|
|
interface: "{{ intname }}"
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-04-23 17:08:49 +02:00
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Check Idempotence - Configure igmp interface with absent state"
|
|
|
|
nxos_igmp_interface: *absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2017-10-25 17:41:23 +02:00
|
|
|
always:
|
2018-04-23 17:08:49 +02:00
|
|
|
- name: Configure igmp interface with absent state
|
|
|
|
nxos_igmp_interface: *absent
|
2017-10-25 17:41:23 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- name: Put interface in default mode
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- "default interface {{ intname }}"
|
|
|
|
match: none
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-10-25 17:41:23 +02:00
|
|
|
|
|
|
|
- name: "Disable feature PIM"
|
|
|
|
nxos_feature:
|
|
|
|
feature: pim
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-10-25 17:41:23 +02:00
|
|
|
state: disabled
|
|
|
|
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_igmp_interface sanity test"
|