2016-10-28 20:50:29 +02:00
|
|
|
---
|
2018-01-05 23:01:45 +01:00
|
|
|
- debug: msg="START connection={{ ansible_connection }}/defaults.yaml"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
2017-09-01 11:44:24 +02:00
|
|
|
# Select interface for test
|
|
|
|
- set_fact: intname="{{ nxos_int1 }}"
|
|
|
|
|
2016-10-28 20:50:29 +02:00
|
|
|
- name: setup
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- no description
|
|
|
|
- shutdown
|
|
|
|
parents:
|
2017-09-01 11:44:24 +02:00
|
|
|
- "interface {{ intname }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
match: none
|
2017-08-21 17:15:25 +02:00
|
|
|
provider: "{{ connection }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- name: configure device with defaults included
|
|
|
|
nxos_config:
|
2017-09-01 11:44:24 +02:00
|
|
|
commands:
|
|
|
|
- description this is a test
|
|
|
|
- no shutdown
|
|
|
|
parents:
|
|
|
|
- "interface {{ intname }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
defaults: yes
|
2017-08-21 17:15:25 +02:00
|
|
|
provider: "{{ connection }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- debug: var=result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-02-25 22:36:00 +01:00
|
|
|
- "result.updates is defined"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- name: check device with defaults included
|
|
|
|
nxos_config:
|
2017-09-01 11:44:24 +02:00
|
|
|
commands:
|
|
|
|
- description this is a test
|
|
|
|
- no shutdown
|
|
|
|
parents:
|
|
|
|
- "interface {{ intname }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
defaults: yes
|
2017-08-21 17:15:25 +02:00
|
|
|
provider: "{{ connection }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- debug: var=result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
- "result.updates is not defined"
|
|
|
|
|
2018-01-05 23:01:45 +01:00
|
|
|
- debug: msg="END connection={{ ansible_connection }}/defaults.yaml"
|