mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
108 lines
2.2 KiB
YAML
108 lines
2.2 KiB
YAML
7 years ago
|
---
|
||
7 years ago
|
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_vrrp sanity test"
|
||
7 years ago
|
|
||
|
- block:
|
||
|
- name: "Enable interface-vlan"
|
||
|
nxos_feature:
|
||
|
feature: interface-vlan
|
||
|
state: enabled
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
7 years ago
|
|
||
|
- name: "Enable vrrp"
|
||
|
nxos_feature:
|
||
|
feature: vrrp
|
||
|
state: enabled
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
7 years ago
|
|
||
|
- name: "create int vlan 10"
|
||
7 years ago
|
nxos_config:
|
||
|
commands: "int vlan 10"
|
||
|
provider: "{{ connection }}"
|
||
7 years ago
|
|
||
|
- name: Ensure vrrp group 100 and vip 10.1.100.1 is on vlan10
|
||
7 years ago
|
nxos_vrrp: &configure
|
||
7 years ago
|
interface: vlan10
|
||
|
group: 100
|
||
|
vip: 10.1.100.1
|
||
7 years ago
|
admin_state: shutdown
|
||
|
provider: "{{ connection }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: &true
|
||
|
that:
|
||
|
- "result.changed == true"
|
||
|
|
||
|
- name: "Conf Idempotence"
|
||
|
nxos_vrrp: *configure
|
||
|
register: result
|
||
|
|
||
|
- assert: &false
|
||
|
that:
|
||
|
- "result.changed == false"
|
||
7 years ago
|
|
||
|
- name: Ensure removal of the vrrp group config
|
||
|
# vip is required to ensure the user knows what they are removing
|
||
|
nxos_vrrp: &remove
|
||
|
interface: vlan10
|
||
|
group: 100
|
||
|
vip: 10.1.100.1
|
||
7 years ago
|
admin_state: shutdown
|
||
7 years ago
|
state: absent
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: *true
|
||
|
|
||
|
- pause:
|
||
|
seconds: 30
|
||
|
|
||
|
- name: "Remove Idempotence"
|
||
|
nxos_vrrp: *remove
|
||
|
register: result
|
||
|
|
||
|
- assert: *false
|
||
7 years ago
|
|
||
|
- pause:
|
||
|
seconds: 30
|
||
|
|
||
|
- name: Re-config with more params
|
||
7 years ago
|
nxos_vrrp: &reconfig
|
||
7 years ago
|
interface: vlan10
|
||
|
group: 100
|
||
|
vip: 10.1.100.1
|
||
|
preempt: false
|
||
|
priority: 130
|
||
|
authentication: AUTHKEY
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: *true
|
||
|
|
||
|
- name: "Reconfig Idempotence"
|
||
|
nxos_vrrp: *reconfig
|
||
|
register: result
|
||
|
|
||
|
- assert: *false
|
||
7 years ago
|
|
||
|
always:
|
||
|
- name: remove vrrp
|
||
|
nxos_vrrp: *remove
|
||
|
ignore_errors: yes
|
||
|
|
||
|
- name: "Disable interface-vlan"
|
||
|
nxos_config:
|
||
|
commands:
|
||
|
- no feature interface-vlan
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
7 years ago
|
match: none
|
||
|
ignore_errors: yes
|
||
|
|
||
|
- name: "Disable vrrp"
|
||
|
nxos_feature:
|
||
|
feature: vrrp
|
||
|
state: disabled
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
7 years ago
|
ignore_errors: yes
|
||
|
|
||
7 years ago
|
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_vrrp sanity test"
|