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/test/integration/targets/ios_file/tests/cli/net_get.yaml

47 lines
1 KiB
YAML
Raw Normal View History

---
- debug: msg="START ios cli/net_get.yaml on connection={{ ansible_connection }}"
# Add minimal testcase to check args are passed correctly to
# implementation module and module run is successful.
- name: setup
ios_config:
lines:
- ip ssh version 2
- ip scp server enable
- username {{ ansible_ssh_user }} privilege 15
match: none
- name: setup (copy file to be fetched from device)
net_put:
src: ios1.cfg
register: result
- name: setup (remove file from localhost if present)
file:
path: ios_{{ ansible_host }}.cfg
state: absent
delegate_to: localhost
- name: get the file from device with relative destination
net_get:
src: ios1.cfg
dest: 'ios_{{ ansible_host }}.cfg'
register: result
- assert:
that:
- result.changed == true
- name: Idempotency check
net_get:
src: ios1.cfg
dest: 'ios_{{ ansible_host }}.cfg'
register: result
- assert:
that:
- result.changed == false
- debug: msg="END ios cli/net_get.yaml on connection={{ ansible_connection }}"