2017-02-26 14:12:57 +01:00
|
|
|
---
|
2018-01-05 23:01:45 +01:00
|
|
|
- debug: msg="START connection={{ ansible_connection }}/configure.yaml"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-02-26 14:12:57 +01:00
|
|
|
|
|
|
|
- name: setup
|
|
|
|
nxos_config:
|
2017-08-10 11:29:13 +02:00
|
|
|
lines: no feature bgp
|
2017-02-26 14:12:57 +01:00
|
|
|
match: none
|
2017-08-17 10:17:14 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-02-26 14:12:57 +01:00
|
|
|
|
2017-08-10 11:29:13 +02:00
|
|
|
- name: enable bgp
|
2017-02-26 14:12:57 +01:00
|
|
|
nxos_feature:
|
2017-08-10 11:29:13 +02:00
|
|
|
feature: bgp
|
2017-02-26 14:12:57 +01:00
|
|
|
state: enabled
|
2017-08-17 10:17:14 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-02-26 14:12:57 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
2017-08-10 11:29:13 +02:00
|
|
|
- name: verify bgp
|
2017-02-26 14:12:57 +01:00
|
|
|
nxos_feature:
|
2017-08-10 11:29:13 +02:00
|
|
|
feature: bgp
|
2017-02-26 14:12:57 +01:00
|
|
|
state: enabled
|
2017-08-17 10:17:14 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-02-26 14:12:57 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2017-08-10 11:29:13 +02:00
|
|
|
- name: disable bgp
|
2017-02-26 14:12:57 +01:00
|
|
|
nxos_feature:
|
2017-08-10 11:29:13 +02:00
|
|
|
feature: bgp
|
2017-02-26 14:12:57 +01:00
|
|
|
state: disabled
|
2017-08-17 10:17:14 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-02-26 14:12:57 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
2017-08-10 11:29:13 +02:00
|
|
|
- name: verify bgp
|
2017-02-26 14:12:57 +01:00
|
|
|
nxos_feature:
|
2017-08-10 11:29:13 +02:00
|
|
|
feature: bgp
|
2017-02-26 14:12:57 +01:00
|
|
|
state: disabled
|
2017-08-17 10:17:14 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-02-26 14:12:57 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: teardown
|
|
|
|
nxos_config:
|
2017-08-10 11:29:13 +02:00
|
|
|
lines: no feature bgp
|
2017-02-26 14:12:57 +01:00
|
|
|
match: none
|
2017-08-17 10:17:14 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-02-26 14:12:57 +01:00
|
|
|
|
2018-01-05 23:01:45 +01:00
|
|
|
- debug: msg="END connection={{ ansible_connection }}/configure.yaml"
|