2016-10-28 20:50:29 +02:00
|
|
|
---
|
2017-12-20 15:03:29 +01:00
|
|
|
- debug: msg="START cli/save.yaml on connection={{ ansible_connection }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- name: setup
|
|
|
|
ios_config:
|
|
|
|
commands:
|
|
|
|
- no description
|
|
|
|
- no shutdown
|
|
|
|
parents:
|
|
|
|
- interface Loopback999
|
|
|
|
match: none
|
2019-01-22 15:18:26 +01:00
|
|
|
save_when: modified
|
2016-10-28 20:50:29 +02:00
|
|
|
|
2019-01-22 15:18:26 +01:00
|
|
|
- name: save should always run
|
2016-10-28 20:50:29 +02:00
|
|
|
ios_config:
|
2019-01-22 15:18:26 +01:00
|
|
|
save_when: always
|
2016-10-28 20:50:29 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
2017-11-09 18:13:49 +01:00
|
|
|
- name: delete config (setup)
|
|
|
|
ios_config:
|
|
|
|
replace: line
|
|
|
|
lines:
|
2017-11-16 08:07:47 +01:00
|
|
|
- "no ip http server"
|
2017-11-09 18:13:49 +01:00
|
|
|
save_when: modified
|
|
|
|
register: result
|
|
|
|
|
2019-01-22 15:18:26 +01:00
|
|
|
- name: save should run when changed
|
2017-11-09 18:13:49 +01:00
|
|
|
ios_config:
|
|
|
|
replace: line
|
|
|
|
lines:
|
|
|
|
- "ip http server"
|
|
|
|
save_when: modified
|
|
|
|
register: result
|
|
|
|
|
2016-10-28 20:50:29 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-11-09 18:13:49 +01:00
|
|
|
|
|
|
|
- name: teardown
|
|
|
|
ios_config:
|
|
|
|
lines:
|
|
|
|
- "no ip http server"
|
|
|
|
register: result
|
2016-10-28 20:50:29 +02:00
|
|
|
|
2017-12-20 15:03:29 +01:00
|
|
|
- debug: msg="END cli/save.yaml on connection={{ ansible_connection }}"
|