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

14 views
Skip to first unread message

Vikram S

unread,
Feb 16, 2021, 3:32:59 AM2/16/21
to Ansible Project

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:pass...@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

2. 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]”

Reply all
Reply to author
Forward
0 new messages