diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
commit | 8a754e0858d922e955e71b253c139e071ecec432 (patch) | |
tree | 527d16e74bfd1840c85efd675fdecad056c54107 /test/integration/targets/incidental_ios_file/tests/cli/net_get.yaml | |
parent | Initial commit. (diff) | |
download | ansible-core-upstream/2.14.3.tar.xz ansible-core-upstream/2.14.3.zip |
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | test/integration/targets/incidental_ios_file/tests/cli/net_get.yaml | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/test/integration/targets/incidental_ios_file/tests/cli/net_get.yaml b/test/integration/targets/incidental_ios_file/tests/cli/net_get.yaml new file mode 100644 index 0000000..5a7ebf0 --- /dev/null +++ b/test/integration/targets/incidental_ios_file/tests/cli/net_get.yaml @@ -0,0 +1,52 @@ +--- +- 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 + cisco.ios.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) + ansible.netcommon.net_put: + src: ios1.cfg + register: result + +- name: setup (remove file from localhost if present) + file: + path: ios_{{ inventory_hostname }}.cfg + state: absent + delegate_to: localhost + +- name: get the file from device with relative destination + ansible.netcommon.net_get: + src: ios1.cfg + dest: 'ios_{{ inventory_hostname }}.cfg' + register: result + +- assert: + that: + - result.changed == true + +- name: Idempotency check + ansible.netcommon.net_get: + src: ios1.cfg + dest: 'ios_{{ inventory_hostname }}.cfg' + register: result + +- assert: + that: + - result.changed == false + +- name: setup (remove file from localhost if present) + file: + path: ios_{{ inventory_hostname }}.cfg + state: absent + delegate_to: localhost + +- debug: msg="END ios cli/net_get.yaml on connection={{ ansible_connection }}" |