ansible/test/integration/targets/exos_config/tests/common/backup.yaml
Ruturaj Vyawahare f872c61712 Added integration tests for the following modules: (#55523)
- exos_facts
- exos_command
- exos_config
2019-08-28 10:48:32 -04:00

35 lines
809 B
YAML

---
- debug: msg="START common/backup.yaml on connection={{ ansible_connection }}"
- name: configure vlan
exos_config:
lines:
- create vlan 100
backup: yes
backup_options:
filename: backup.cfg
dir_path: '{{ role_path }}'
register: result
- set_fact: content="{{ lookup('file', '{{ role_path }}/backup.cfg') }}"
- name: Assert local file creation
assert:
that:
- "content is search('Module devmgr')"
- name: delete configurable backup file path
file:
path: "{{ role_path }}/backup.cfg"
state: absent
- name: Restore original configuration
exos_config:
lines:
- delete vlan 100
- name: Save the configuration to startup
exos_config:
save_when: modified
- debug: msg="END common/backup.yaml on connection={{ ansible_connection }}"