2018-05-16 11:08:43 +02:00
|
|
|
---
|
2018-05-18 11:11:47 +02:00
|
|
|
- debug: msg="START ios cli/net_get.yaml on connection={{ ansible_connection }}"
|
2018-05-16 11:08:43 +02:00
|
|
|
|
|
|
|
# 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)
|
2018-05-18 11:11:47 +02:00
|
|
|
net_put:
|
2018-05-16 11:08:43 +02:00
|
|
|
src: ios1.cfg
|
|
|
|
register: result
|
|
|
|
|
2018-07-05 16:45:25 +02:00
|
|
|
- name: setup (remove file from localhost if present)
|
|
|
|
file:
|
2018-07-12 08:56:14 +02:00
|
|
|
path: ios_{{ inventory_hostname }}.cfg
|
2018-07-05 16:45:25 +02:00
|
|
|
state: absent
|
|
|
|
delegate_to: localhost
|
2018-05-16 11:08:43 +02:00
|
|
|
|
2018-07-05 16:45:25 +02:00
|
|
|
- name: get the file from device with relative destination
|
2018-05-18 11:11:47 +02:00
|
|
|
net_get:
|
2018-05-16 11:08:43 +02:00
|
|
|
src: ios1.cfg
|
2018-07-12 08:56:14 +02:00
|
|
|
dest: 'ios_{{ inventory_hostname }}.cfg'
|
2018-05-16 11:08:43 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- result.changed == true
|
|
|
|
|
2018-07-05 16:45:25 +02:00
|
|
|
- name: Idempotency check
|
2018-05-18 11:11:47 +02:00
|
|
|
net_get:
|
2018-05-16 11:08:43 +02:00
|
|
|
src: ios1.cfg
|
2018-07-12 08:56:14 +02:00
|
|
|
dest: 'ios_{{ inventory_hostname }}.cfg'
|
2018-05-16 11:08:43 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2018-07-05 16:45:25 +02:00
|
|
|
- result.changed == false
|
2018-05-16 11:08:43 +02:00
|
|
|
|
2018-07-12 08:56:14 +02:00
|
|
|
- name: setup (remove file from localhost if present)
|
|
|
|
file:
|
|
|
|
path: ios_{{ inventory_hostname }}.cfg
|
|
|
|
state: absent
|
|
|
|
delegate_to: localhost
|
|
|
|
|
2018-05-18 11:11:47 +02:00
|
|
|
- debug: msg="END ios cli/net_get.yaml on connection={{ ansible_connection }}"
|