Hi,
I wrote a script to check if particular IOS version is set as boot statement. But it doesn’t work. What am i doing wrong?
name: Gather show boot
ios_command:
commands: “show boot”
register: show_boot
debug:
msg: “{{ ‘show_boot.stdout’ | regex_findall(‘c2960x-universalk9-mz.152-7.E3.bin’) }}”
Also another objective is match number of boot statements set to number of stacked switches so that i can ensure all stacked switches have the correct boot statement set. So iam trying to match number of times IOS image is set in ‘show boot’ output to number of times a switch is in ‘ready’ state in ‘show switch’ output.
Below is a login i have come up with but not sure if this will work? Please give your suggestion for improvement if any?
msg: “{{ ‘show_boot.stdout’ | regex_findall(‘c2960x-universalk9-mz.152-7.E3.bin’) | length }}” == msg: “{{ ‘show_switch.stdout’ | regex_findall(‘ready’) | length }}”