mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-28 23:51:23 -07:00
network_put and network_get modules (#39592)
* Initial commit * Socket Timeout and dest file handler * sftp handling * module name change as per review * multiple thread tmp file overwite problem * Integration test suite for network_put * add additional testcase for dest argument * fix pylint/pep8/modules warnings * add socket timeout for get_file * network_get module * pep8 issue on network_get * Review comments
This commit is contained in:
parent
05c4f5997e
commit
86c945a628
12 changed files with 543 additions and 5 deletions
43
test/integration/targets/ios_file/tests/cli/network_get.yaml
Normal file
43
test/integration/targets/ios_file/tests/cli/network_get.yaml
Normal file
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
- debug: msg="START ios cli/network_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)
|
||||
network_put:
|
||||
src: ios1.cfg
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result.changed == true
|
||||
|
||||
- name: get the file from device with dest unspecified
|
||||
network_get:
|
||||
src: ios1.cfg
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result.changed == true
|
||||
|
||||
- name: get the file from device with relative destination
|
||||
network_get:
|
||||
src: ios1.cfg
|
||||
dest: 'ios_{{ ansible_host }}.cfg'
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result.changed == true
|
||||
|
||||
- debug: msg="END ios cli/network_get.yaml on connection={{ ansible_connection }}"
|
34
test/integration/targets/ios_file/tests/cli/network_put.yaml
Normal file
34
test/integration/targets/ios_file/tests/cli/network_put.yaml
Normal file
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
- debug: msg="START ios cli/network_put.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: copy file from controller to ios + scp (Default)
|
||||
network_put:
|
||||
src: ios1.cfg
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result.changed == true
|
||||
|
||||
- name: copy file from controller to ios + dest specified
|
||||
network_put:
|
||||
src: ios1.cfg
|
||||
dest: ios.cfg
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result.changed == true
|
||||
|
||||
- debug: msg="END ios cli/network_put.yaml on connection={{ ansible_connection }}"
|
Loading…
Add table
Add a link
Reference in a new issue