2016-10-28 20:50:29 +02:00
|
|
|
---
|
2018-05-18 00:47:15 +02:00
|
|
|
- debug: msg="START common/src_basic.yaml on connection={{ ansible_connection }}"
|
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
|
|
|
|
- no shutdown
|
|
|
|
parents:
|
2017-09-01 11:44:24 +02:00
|
|
|
- "interface {{ intname }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
match: none
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- name: configure device with config
|
|
|
|
nxos_config:
|
2017-09-01 11:44:24 +02:00
|
|
|
commands:
|
|
|
|
- description this is a test
|
|
|
|
- shutdown
|
|
|
|
parents:
|
|
|
|
- "interface {{ intname }}"
|
2017-02-23 22:59:29 +01:00
|
|
|
defaults: yes
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
# https://github.com/ansible/ansible-modules-core/issues/4807
|
2017-02-25 22:36:00 +01:00
|
|
|
- "result.updates is defined"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- name: check device with config
|
|
|
|
nxos_config:
|
2017-09-01 11:44:24 +02:00
|
|
|
commands:
|
|
|
|
- description this is a test
|
|
|
|
- shutdown
|
|
|
|
parents:
|
|
|
|
- "interface {{ intname }}"
|
2017-02-23 22:59:29 +01:00
|
|
|
defaults: yes
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
# https://github.com/ansible/ansible-modules-core/issues/4807
|
|
|
|
- "result.updates is not defined"
|
|
|
|
|
2018-05-18 00:47:15 +02:00
|
|
|
- debug: msg="END common/src_basic.yaml on connection={{ ansible_connection }}"
|