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