-
Notifications
You must be signed in to change notification settings - Fork 0
/
net_put.yml
34 lines (31 loc) · 898 Bytes
/
net_put.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- name: Ansible Playbook to upgrade Cisco IOS
hosts: 1800series
#hosts: 2900series
gather_facts: false
vars:
ansible_command_timeout: 600
tftp_server: 10.10.1.54
#ios_file: hq_facts.txt
#src_file: "/srv/tftp/hq_facts.txt"
src_path: "/home/swt/Repo/Automation/Ansible_examples/software_update/"
src_file: "hq_facts.txt"
tasks:
- name: Collect ios facts
ios_facts:
gather_subset:
- hardware
tags: hwinfo
- name: Copy File to router/swtich flash
ansible.netcommon.net_put:
src: "{{ src_path }}/{{ src_file }}"
dest: flash:/{{ src_file }}
#protocol: sftp
tags: cp_ios
- name: Check wheter transfered file is present
cisco.ios.ios_command:
commands:
- show flash
wait_for:
- result[0] contains "{{ src_file }}"
...