@ -3,9 +3,14 @@
- debug : msg="Using provider={{ connection.transport }}"
when : ansible_connection == "local"
- set_fact : bidir="true"
- set_fact : bidir="false"
when : platform is match("N3L")
- block:
# N3L does not support bidir
- set_fact : bidir_true="true"
- set_fact : bidir_false="false"
# N3L can only remove rpa, cannot remove rpa+prefixlist or rpa+routemap
- set_fact : pim_prefix_list="pim_prefix_list"
- set_fact : pim_route_map="pim_route_map"
when : platform is not match("N3L")
- block:
- name : "Disable feature PIM"
@ -20,11 +25,12 @@
provider : "{{ connection }}"
state : enabled
- name : Configure rp_address + group_list
- name : 1.0 Configure rp_address + group_list
# This test should always run regardless of bidir support
nxos_pim_rp_address : &configgl
rp_address : "10.1.1. 20 "
rp_address : "10.1.1. 1 "
group_list : "224.0.0.0/8"
bidir : "{{ bidir }}"
bidir : "{{ bidir _true|default(omit) }}"
provider : "{{ connection }}"
state : present
register : result
@ -33,7 +39,7 @@
that:
- "result.changed == true"
- name : Check i dempotence rp_address + group_list
- name : 1.0 I dempotence rp_address + group_list
nxos_pim_rp_address : *configgl
register : result
@ -41,66 +47,60 @@
that:
- "result.changed == false"
- name: Configure rp_address + group_list remove bidir
nxos_pim_rp_address : &configglnb
rp_address: "10.1.1.20"
group_list : "224.0.0.0/8 "
bidir : False
provider : "{{ connection }}"
state : present
register : resul t
when : platform is not match("N3L")
- block: # bidir test
- name : 1.1 Configure rp_address + group_list (bidir_false)
nxos_pim_rp_address: &config11
rp_address : "10.1.1.1 "
group_list : "224.0.0.0/8"
bidir : false
provider : "{{ connection }}"
state : presen t
register : result
- assert : *true
when : platform is not match("N3L")
- assert : *true
- name : Check idempotence rp_address + group_list remove bidir
nxos_pim_rp_address : *configglnb
register : result
when : platform is not match("N3L")
- name : 1.1 Idempotence rp_address + group_list (bidir_false)
nxos_pim_rp_address : *config11
register : result
- assert : *false
when : platform is not match("N3L")
- assert : *false
- name : Configure rp_address + bidir
nxos_pim_rp_address : &config bi
rp_address : "10.1.1. 20 "
bidir : "{{ bidir }}"
provider : "{{ connection }}"
state : present
register : result
- name : 1.2 Configure rp_address (bidir_true)
nxos_pim_rp_address : &config 12
rp_address : "10.1.1. 1 "
bidir : true
provider : "{{ connection }}"
state : present
register : result
- assert : *true
- assert : *true
- name : Check idempotence rp_address + bidir
nxos_pim_rp_address : *config bi
register : result
- name : 1.2 Idempotence rp_address (bidir_true)
nxos_pim_rp_address : *config 12
register : result
- assert : *false
- assert : *false
- name : Configure rp_address remove bidir
nxos_pim_rp_address : &confignbi
rp_address : "10.1.1.20"
bidir : False
provider : "{{ connection }}"
state : present
register : result
when : platform is not match("N3L")
- name : 1.3 Configure rp_address (bidir_false)
nxos_pim_rp_address : &config13
rp_address : "10.1.1.1"
bidir : false
provider : "{{ connection }}"
state : present
register : result
- assert : *true
when : platform is not match("N3L")
- assert : *true
- name : Check idempotence rp_address remove bidir
nxos_pim_rp_address : *confignbi
register : result
when : platform is not match("N3L")
- name : 1.3 Idempotence rp_address (bidir_false)
nxos_pim_rp_address : *config13
register : result
- assert : *false
when : platform is not match("N3L")
- assert : *false
when : bidir_true is defined
- name : Remove rp_address + group_list
nxos_pim_rp_address : &config glr
rp_address : "10.1.1. 20 "
- name : 1.4 Remove rp_address + group_list
nxos_pim_rp_address : &config 14
rp_address : "10.1.1. 1 "
group_list : "224.0.0.0/8"
provider : "{{ connection }}"
state : absent
@ -108,133 +108,114 @@
- assert : *true
- name : Check remove idempotence rp_address + group_list
nxos_pim_rp_address : *configglr
register : result
- assert : *false
- name : Remove rp_address
nxos_pim_rp_address : &configbir
rp_address : "10.1.1.20"
provider : "{{ connection }}"
state : absent
register : result
- assert : *true
- name : Check remove idempotence rp_address
nxos_pim_rp_address : *configbir
- name : 1.4 Idempotence remove rp_address + group_list
nxos_pim_rp_address : *config14
register : result
- assert : *false
- name : Configure rp_address + prefix_list + bidir
nxos_pim_rp_address : &config pl
rp_address : "10.1.1.2 0 "
prefix_list : " pim_prefix_list"
bidir : "{{ bidir }}"
- name : 2.0 Configure rp_address + prefix_list (bidir_true)
nxos_pim_rp_address : &config20
rp_address : "10.1.1.2"
prefix_list : "{{ pim_prefix_list|default(omit) }}"
bidir : "{{ bidir_true|default(omit) }}"
provider : "{{ connection }}"
state : present
register : result
- assert : *true
- name : Check idempotence rp_address + prefix_list + bidir
nxos_pim_rp_address : *config pl
- name : 2.0 Idempotence rp_address + prefix_list (bidir_true)
nxos_pim_rp_address : *config 20
register : result
- assert : *false
- name : Configure rp_address + prefix_list
nxos_pim_rp_address : &configplnbi
rp_address : "10.1.1.20"
prefix_list : "pim_prefix_list"
bidir : False
provider : "{{ connection }}"
state : present
register : result
when : platform is not match("N3L")
- assert : *true
when : platform is not match("N3L")
- name : Check idempotence rp_address + prefix_list
nxos_pim_rp_address : *configplnbi
register : result
when : platform is not match("N3L")
- assert : *false
when : platform is not match("N3L")
- name : Remove rp_address + prefix_list
nxos_pim_rp_address : &configplr
rp_address : "10.1.1.20"
prefix_list : "pim_prefix_list"
bidir : False
- block : # bidir test
- name : 2.1 Configure rp_address + prefix_list (bidir_false)
nxos_pim_rp_address : &config21
rp_address : "10.1.1.2"
prefix_list : "{{ pim_prefix_list|default(omit) }}"
bidir : "{{ bidir_false|default(omit) }}"
provider : "{{ connection }}"
state : present
register : result
- assert : *true
- name : 2.1 Idempotence rp_address + prefix_list (bidir_false)
nxos_pim_rp_address : *config21
register : result
- assert : *false
when : bidir_false is defined
- name : 2.2 Remove rp_address + prefix_list (bidir_false)
nxos_pim_rp_address : &config22
rp_address : "10.1.1.2"
prefix_list : "{{ pim_prefix_list|default(omit)}}"
bidir : "{{ bidir_false|default(omit)}}"
provider : "{{ connection }}"
state : absent
register : result
- assert : *true
- name : Check remove idempotence rp_address + prefix_list
nxos_pim_rp_address : *configplr
register : result
- assert : *false
- name : Configure rp_address + route_map + bidir
nxos_pim_rp_address : &configrm
rp_address : "10.1.1.20"
route_map : "pim_routemap"
bidir : "{{ bidir }}"
provider : "{{ connection }}"
state : present
register : result
- assert : *true
- name : Check idempotence rp_address + route_map + bidir
nxos_pim_rp_address : *configrm
- name : 2.2 Idempotence remove rp_address + prefix_list (bidir_false)
nxos_pim_rp_address : *config22
register : result
- assert : *false
- name : Configure rp_address + route_map
nxos_pim_rp_address : &config rmnbi
rp_address : "10.1.1. 20 "
route_map : " pim_routemap"
bidir : False
- name : 3.0 Configure rp_address + route_map + (bidir_true)
nxos_pim_rp_address : &config30
rp_address : "10.1.1.3"
route_map : "{{ pim_route_map|default(omit)}}"
bidir : "{{ bidir_true|default(omit) }}"
provider : "{{ connection }}"
state : present
register : result
when : platform is not match("N3L")
- assert : *true
when : platform is not match("N3L")
- name : Check idempotence rp_address + route_map
nxos_pim_rp_address : *config rmnbi
- name : 3.0 Idempotence rp_address + route_map + (bidir_true)
nxos_pim_rp_address : *config30
register : result
when : platform is not match("N3L")
- assert : *false
when : platform is not match("N3L")
- name : Remove rp_address + route_map
nxos_pim_rp_address : &configrmr
rp_address : "10.1.1.20"
route_map : "pim_routemap"
bidir : False
- block : # bidir test
- name : 3.1 Configure rp_address + route_map (bidir_false)
nxos_pim_rp_address : &config31
rp_address : "10.1.1.3"
route_map : "{{ pim_route_map|default(omit)}}"
bidir : "{{ bidir_false|default(omit)}}"
provider : "{{ connection }}"
state : present
register : result
- assert : *true
- name : 3.1 Idempotence rp_address + route_map
nxos_pim_rp_address : *config31
register : result
- assert : *false
when : bidir_false is defined
- name : 3.2 Remove rp_address + route_map (bidir_false)
nxos_pim_rp_address : &config32
rp_address : "10.1.1.3"
route_map : "{{ pim_route_map|default(omit)}}"
bidir : "{{ bidir_false|default(omit)}}"
provider : "{{ connection }}"
state : absent
register : result
- assert : *true
- name : Check remove idempotence rp_address + route_map
nxos_pim_rp_address : *configrmr
- name : 3.2 Idempotence remove rp_address + route_map (bidir_false)
nxos_pim_rp_address : *config 32
register : result
- assert : *false