2017-08-17 10:44:10 +02:00
|
|
|
---
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_vtp_version sanity test"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-08-17 10:44:10 +02:00
|
|
|
|
2019-05-10 07:24:51 +02:00
|
|
|
- set_fact: vtp_run="true"
|
|
|
|
- set_fact: vtp_run="false"
|
|
|
|
when: platform is search('N3K-F|N9K-F')
|
|
|
|
|
2017-08-17 10:44:10 +02:00
|
|
|
- block:
|
2019-05-10 07:24:51 +02:00
|
|
|
- name: disable feature vtp
|
|
|
|
nxos_feature:
|
|
|
|
feature: vtp
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
state: disabled
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2017-08-17 10:44:10 +02:00
|
|
|
- name: enable feature vtp
|
|
|
|
nxos_feature:
|
|
|
|
feature: vtp
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-08-17 10:44:10 +02:00
|
|
|
state: enabled
|
|
|
|
|
2019-06-06 06:05:30 +02:00
|
|
|
- name: configure supporting vtp domain
|
|
|
|
nxos_vtp_domain:
|
|
|
|
domain: foo
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
|
2017-08-17 10:44:10 +02:00
|
|
|
- name: configure vtp version
|
2017-09-01 11:59:21 +02:00
|
|
|
nxos_vtp_version: &configure
|
2017-08-17 10:44:10 +02:00
|
|
|
version: 2
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-09-01 11:59:21 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2019-06-06 06:05:30 +02:00
|
|
|
|
2017-09-01 11:59:21 +02:00
|
|
|
- name: "Conf Idempotence"
|
|
|
|
nxos_vtp_version: *configure
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
2017-08-17 10:44:10 +02:00
|
|
|
|
2019-06-06 06:05:30 +02:00
|
|
|
when: vtp_run | bool
|
2019-05-10 07:24:51 +02:00
|
|
|
|
2017-08-17 10:44:10 +02:00
|
|
|
always:
|
|
|
|
- name: disable feature vtp
|
|
|
|
nxos_feature:
|
|
|
|
feature: vtp
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-08-17 10:44:10 +02:00
|
|
|
state: disabled
|
|
|
|
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_vtp_version sanity test"
|