2017-09-14 20:36:32 +00:00
|
|
|
---
|
2018-01-05 17:39:04 +00:00
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_pim_interface sanity test"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-09-14 20:36:32 +00:00
|
|
|
|
|
|
|
- name: "Disable feature PIM"
|
|
|
|
nxos_feature: &disable_feature
|
|
|
|
feature: pim
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-09-14 20:36:32 +00:00
|
|
|
state: disabled
|
|
|
|
|
|
|
|
- name: "Enable feature PIM"
|
|
|
|
nxos_feature:
|
|
|
|
feature: pim
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-09-14 20:36:32 +00:00
|
|
|
state: enabled
|
|
|
|
|
|
|
|
- set_fact: testint="{{ nxos_int1 }}"
|
|
|
|
|
|
|
|
- name: "Setup: Put interface {{ testint }} into a default state"
|
|
|
|
nxos_config:
|
|
|
|
lines:
|
|
|
|
- "default interface {{ testint }}"
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-09-14 20:36:32 +00:00
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: "Ensure {{testint}} is layer3"
|
|
|
|
nxos_interface:
|
|
|
|
interface: "{{ testint }}"
|
|
|
|
mode: layer3
|
|
|
|
description: 'Configured by Ansible - Layer3'
|
|
|
|
admin_state: 'up'
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-09-14 20:36:32 +00:00
|
|
|
state: present
|
|
|
|
|
|
|
|
- block:
|
2018-01-31 05:21:11 +00:00
|
|
|
- name: Configure nxos_pim_interface state absent
|
|
|
|
nxos_pim_interface: &pimabsent
|
2017-09-14 20:36:32 +00:00
|
|
|
interface: "{{ testint }}"
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-01-31 05:21:11 +00:00
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: configure jp policy and type
|
|
|
|
nxos_pim_interface: &configjp
|
|
|
|
interface: "{{ testint }}"
|
|
|
|
jp_policy_in: JPIN
|
|
|
|
jp_policy_out: JPOUT
|
|
|
|
jp_type_in: routemap
|
|
|
|
jp_type_out: routemap
|
|
|
|
sparse: True
|
|
|
|
border: True
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-09-14 20:36:32 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: Check idempotence
|
2018-01-31 05:21:11 +00:00
|
|
|
nxos_pim_interface: *configjp
|
2017-09-14 20:36:32 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2018-01-31 05:21:11 +00:00
|
|
|
- name: configure neighbor policy and rm
|
|
|
|
nxos_pim_interface: &confignpr
|
2017-09-14 20:36:32 +00:00
|
|
|
interface: "{{ testint }}"
|
2018-01-31 05:21:11 +00:00
|
|
|
neighbor_policy: NPR
|
|
|
|
neighbor_type: routemap
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-09-14 20:36:32 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Check idempotence
|
2018-01-31 05:21:11 +00:00
|
|
|
nxos_pim_interface: *confignpr
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- pause:
|
|
|
|
seconds: 5
|
|
|
|
|
|
|
|
- name: configure neighbor policy and prefix
|
|
|
|
nxos_pim_interface: &confignpp
|
|
|
|
interface: "{{ testint }}"
|
|
|
|
neighbor_policy: NPPF
|
|
|
|
neighbor_type: prefix
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-01-31 05:21:11 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Check idempotence
|
|
|
|
nxos_pim_interface: *confignpp
|
2017-09-14 20:36:32 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2018-01-31 05:21:11 +00:00
|
|
|
- name: configure hello_auth_key
|
|
|
|
nxos_pim_interface: &confighak1
|
|
|
|
interface: "{{ testint }}"
|
|
|
|
hello_auth_key: password1
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-01-31 05:21:11 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: configure pim other params
|
|
|
|
nxos_pim_interface: &configo
|
|
|
|
interface: "{{ testint }}"
|
|
|
|
dr_prio: 10
|
|
|
|
hello_interval: 40
|
|
|
|
sparse: True
|
|
|
|
border: True
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-01-31 05:21:11 +00:00
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Check idempotence
|
|
|
|
nxos_pim_interface: *configo
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: configure negative
|
|
|
|
nxos_pim_interface: &configno
|
|
|
|
interface: "{{ testint }}"
|
|
|
|
sparse: False
|
|
|
|
border: False
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-01-31 05:21:11 +00:00
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Check idempotence
|
|
|
|
nxos_pim_interface: *configno
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- pause:
|
|
|
|
seconds: 5
|
|
|
|
|
2017-09-14 20:36:32 +00:00
|
|
|
- name: configure state default
|
|
|
|
nxos_pim_interface: &configdefault
|
|
|
|
interface: "{{ testint }}"
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-09-14 20:36:32 +00:00
|
|
|
state: default
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Check idempotence
|
|
|
|
nxos_pim_interface: *configdefault
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2018-01-31 05:21:11 +00:00
|
|
|
- name: configure border
|
|
|
|
nxos_pim_interface: &configb
|
|
|
|
interface: "{{ testint }}"
|
|
|
|
border: True
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-01-31 05:21:11 +00:00
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Check idempotence
|
|
|
|
nxos_pim_interface: *configb
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: configure state absent
|
|
|
|
nxos_pim_interface: *pimabsent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Check idempotence
|
|
|
|
nxos_pim_interface: *pimabsent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2017-09-14 20:36:32 +00:00
|
|
|
always:
|
|
|
|
- name: "Disable feature PIM"
|
|
|
|
nxos_feature: *disable_feature
|
|
|
|
|
2018-01-05 17:39:04 +00:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_pim_interface sanity test"
|