1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/exos_config/tests/common/backup.yaml

36 lines
809 B
YAML
Raw Normal View History

2020-03-09 10:11:07 +01:00
---
- 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 }}"