# Need assistance with ansible script for IOS image copying and MD5 verification

**URL:** <https://forum.ansible.com/t/need-assistance-with-ansible-script-for-ios-image-copying-and-md5-verification/34627>\
**Category:** Ansible Project\
**Created:** [February 16, 2021, 8:32am UTC](https://forum.ansible.com/t/need-assistance-with-ansible-script-for-ios-image-copying-and-md5-verification/34627 "2021-02-16T08:32:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikram\_S](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@Vikram\_S](https://forum.ansible.com/u/Vikram_S)\
**Post date:** [February 16, 2021, 8:32am UTC](https://forum.ansible.com/t/need-assistance-with-ansible-script-for-ios-image-copying-and-md5-verification/34627/1 "2021-02-16T08:32:59Z")

</div>

1. Can i use below script to copy? iam using below command because i don’t have IOS image stored in ansible controller, rather in a FTP server (10.4.1.104)

tasks:  
– name: copy image  
cli\_command:  
command: copy ftp://username:password@10.4.1.104/isr4300-universalk9.16.03.07.SPA.bin flash:  
prompt:  
– destination filename  
answer:  
– isr4300-universalk9.16.03.07.SPA.bin

register: output

1. How do i MD5 verification after copying image?

I wrote below TASK for MD5 verification but it didn’t work. Iam wondering if i should use ios\_command or ios\_config module for MD5 verification or some other module?

tasks:  
name: show hostname  
ios\_config:  
lines:  
verify /md5 flash:isr4300-universalk9.16.03.07.SPA.bin

register: output

debug:  
var: output  
when: “‘6179d9f5cea5f6274bbccfe13d4ca641’ in output.stdout[0]”
