I usually use below script to check free space before proceeding to copy image. But when i need to copy image to a stacked switch, will this command show free space in ALL member switches or will it show only master switch free space?
I don’t have a stacked switch to test. So need your advise before i implement in prod.
name: Gather IOS Facts
ios_facts:
- debug:
msg: - “Free space is {{ ansible_net_memfree_mb }}”
If i give additional command that image need to be copied only if i give a conditional that image should be copied only when free space is above certain MB, will ii check this conditional only for master switch or for all memnber switches?
-
name: COPY IOS IMAGE TO DEVICE AND ALLOW MAXIMUM TIME OF 60 MINS TO FINISH
ios_command: commands: - command: "copy
ftp://username:password@10.6.1.104/cat3k_caa-universalk9.16.03.09.SPA.bin flash:"
prompt: ‘Destination filename [cat3k_caa-universalk9.16.03.09.SPA.bin]?’ answer: “\r” vars: ansible_command_timeout: 3600
-
when: - ansible_net_memfree_mb >= 1113