But below 'when' syntax works for ios_command module. Should i modify the syntax or am i writing it wrong?
- name: GATHER PACKAGES.CONF FILE INFO IN FLASH
ios_command:
commands: "show flash: | i packages.conf"
register: show_flash_packages
- name: ADD PACKAGES.CONF AS BOOT STATEMENT WHEN THIS FILE IS UPDATED
ios_config:
lines:
- boot system flash:packages.conf
when:
- "'Apr 09 2021' in show_flash_packages.stdout[0] or
'Apr 10 2021' in show_flash_packages.stdout[0]"