2016-10-28 19:50:29 +01:00
|
|
|
---
|
2018-05-17 18:47:15 -04:00
|
|
|
- debug: msg="START common/src_basic.yaml on connection={{ ansible_connection }}"
|
2016-10-28 19:50:29 +01:00
|
|
|
|
2019-02-28 00:37:03 -05:00
|
|
|
- set_fact: intname="loopback1"
|
2017-09-01 05:44:24 -04:00
|
|
|
|
2016-10-28 19:50:29 +01:00
|
|
|
- name: setup
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- no description
|
|
|
|
- no shutdown
|
|
|
|
parents:
|
2017-09-01 05:44:24 -04:00
|
|
|
- "interface {{ intname }}"
|
2016-10-28 19:50:29 +01:00
|
|
|
match: none
|
2018-07-02 09:43:51 -04:00
|
|
|
provider: "{{ connection }}"
|
2016-10-28 19:50:29 +01:00
|
|
|
|
|
|
|
- name: configure device with config
|
|
|
|
nxos_config:
|
2019-02-28 00:37:03 -05:00
|
|
|
src: basic/config.j2
|
2018-07-02 09:43:51 -04:00
|
|
|
provider: "{{ connection }}"
|
2019-02-28 00:37:03 -05:00
|
|
|
defaults: yes
|
2016-10-28 19:50:29 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
# https://github.com/ansible/ansible-modules-core/issues/4807
|
2017-02-25 16:36:00 -05:00
|
|
|
- "result.updates is defined"
|
2016-10-28 19:50:29 +01:00
|
|
|
|
|
|
|
- name: check device with config
|
|
|
|
nxos_config:
|
2019-02-28 00:37:03 -05:00
|
|
|
src: basic/config.j2
|
2018-07-02 09:43:51 -04:00
|
|
|
provider: "{{ connection }}"
|
2016-10-28 19:50:29 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
# https://github.com/ansible/ansible-modules-core/issues/4807
|
|
|
|
- "result.updates is not defined"
|
|
|
|
|
2018-05-17 18:47:15 -04:00
|
|
|
- debug: msg="END common/src_basic.yaml on connection={{ ansible_connection }}"
|