# copying bin file from ansible control server to switch

**URL:** <https://forum.ansible.com/t/copying-bin-file-from-ansible-control-server-to-switch/30413>\
**Category:** Ansible Project\
**Created:** [May 24, 2019, 10:53am UTC](https://forum.ansible.com/t/copying-bin-file-from-ansible-control-server-to-switch/30413 "2019-05-24T10:53:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [May 24, 2019, 10:53am UTC](https://forum.ansible.com/t/copying-bin-file-from-ansible-control-server-to-switch/30413/1 "2019-05-24T10:53:23Z")

</div>

Hi team,

Can you please provide me the module to copy the IOS image file to cisco switch?

I used below but it prompts for password

- name: COPY OVER IOS IMAGE

command: “scp system-image-filename.bin {{inventory\_hostname}}:/system-image-filename.bin”

- name: SET BOOT SYSTEM FLASH  
ios\_config:  
commands:
- “boot system flash:system-image-filename.bin”

---

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [May 24, 2019, 1:04pm UTC](https://forum.ansible.com/t/copying-bin-file-from-ansible-control-server-to-switch/30413/2 "2019-05-24T13:04:13Z")

</div>

I am getting below error

“msg”: “Exception received : Administratively disabled.\n”

my playbook is

- name: Copying file from Ansible  
net\_put:  
src: /home/testuser/ansible/from\_ansible.text

- name: copying IOS image to cisco switch  
net\_put:  
src: /home/testuser/ansible/from\_ansible.text  
protocol: tftp  
dest: flash:/from\_ansible.text

---

<div class="post-metadata">

**Author:** ![Richard\_Bywater1](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@Richard\_Bywater1](https://forum.ansible.com/u/Richard_Bywater1)\
**Post date:** [May 25, 2019, 11:11am UTC](https://forum.ansible.com/t/copying-bin-file-from-ansible-control-server-to-switch/30413/3 "2019-05-25T11:11:54Z")

</div>

Based on a quick GOogle search that gives [https://community.cisco.com/t5/network-management/distribute-sw-images-through-scp-failed/td-p/706491](https://community.cisco.com/t5/network-management/distribute-sw-images-through-scp-failed/td-p/706491) , this sounds more like a Cisco config issue than an Ansible one.

Richard.

---

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [May 25, 2019, 4:05pm UTC](https://forum.ansible.com/t/copying-bin-file-from-ansible-control-server-to-switch/30413/4 "2019-05-25T16:05:13Z")

</div>

Great thanks
