ansible/test/integration/targets/ios_config/tests/cli/save.yaml
Nathaniel Case f3337e1fba
ios test changes (#35510)
* Fix over-byte

* Update ios tests to call `provider`

To continue to support testing `connection: local`

* Fix command dict handling in ios_user

* Clean up unit tests, too
2018-02-02 09:50:15 -05:00

66 lines
1.3 KiB
YAML

---
- debug: msg="START cli/save.yaml on connection={{ ansible_connection }}"
- name: setup
ios_config:
commands:
- no description
- no shutdown
parents:
- interface Loopback999
match: none
provider: "{{ cli }}"
- name: save config
ios_config:
save: true
provider: "{{ cli }}"
register: result
# FIXME https://github.com/ansible/ansible-modules-core/issues/5008
ignore_errors: true
- assert:
that:
- "result.changed == true"
# FIXME https://github.com/ansible/ansible-modules-core/issues/5008
ignore_errors: true
- name: save should always run
ios_config:
save: true
provider: "{{ cli }}"
register: result
# FIXME https://github.com/ansible/ansible-modules-core/issues/5008
ignore_errors: true
- name: delete config (setup)
ios_config:
replace: line
lines:
- "no ip http server"
save_when: modified
provider: "{{ cli }}"
register: result
- name: save should always run
ios_config:
replace: line
lines:
- "ip http server"
save_when: modified
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- name: teardown
ios_config:
lines:
- "no ip http server"
provider: "{{ cli }}"
register: result
- debug: msg="END cli/save.yaml on connection={{ ansible_connection }}"