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
|
2018-02-02 15:50:15 +01:00
|
|
|
provider: "{{ cli }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
- name: save config
|
|
|
|
ios_config:
|
|
|
|
save: true
|
2018-02-02 15:50:15 +01:00
|
|
|
provider: "{{ cli }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: save should always run
|
|
|
|
ios_config:
|
|
|
|
save: true
|
2018-02-02 15:50:15 +01:00
|
|
|
provider: "{{ cli }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
register: result
|
|
|
|
|
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
|
2018-02-02 15:50:15 +01:00
|
|
|
provider: "{{ cli }}"
|
2017-11-09 18:13:49 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- name: save should always run
|
|
|
|
ios_config:
|
|
|
|
replace: line
|
|
|
|
lines:
|
|
|
|
- "ip http server"
|
|
|
|
save_when: modified
|
2018-02-02 15:50:15 +01:00
|
|
|
provider: "{{ cli }}"
|
2017-11-09 18:13:49 +01:00
|
|
|
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"
|
2018-02-02 15:50:15 +01:00
|
|
|
provider: "{{ cli }}"
|
2017-11-09 18:13:49 +01:00
|
|
|
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 }}"
|