Hi,
Below condition in statement 1 and 2 checks the number of boot statement
set in switch matches with number of member switches available to ensure
that correct boot statement is set for every member switch. Both statement
1 and 2 work when i give them individually.
But they fail when i use to it in assert statement as 'OR' conditional. How
should i modify the syntax to make it work?
Statament 1:
show_boot_new.stdout[0] | regex_findall('BOOT variable =
flash:packages.conf') | length == show_switch.stdout[0] |
regex_findall('Ready') | length
Statement 2:
show_boot_new.stdout[0] | regex_findall('BOOT variable =
flash:cat3k_caa-universalk9.16.09.06.SPA.conf') | length ==
show_switch.stdout[0] | regex_findall('Ready') | length
- assert:
that:
- show_boot_new.stdout[0] | regex_findall('BOOT variable =
flash:packages.conf') | length == show_switch.stdout[0] |
regex_findall('Ready') | length *or*
show_boot_new.stdout[0] | regex_findall('BOOT variable =
flash:cat3k_caa-universalk9.16.09.06.SPA.conf') | length ==
show_switch.stdout[0] | regex_findall('Ready') | length
fail_msg: "BOOT STATEMENT IS NOT SET FOR ALL MEMBERS SWITCHES.
PLAYBOOK IS ENDING FOR HOST."
success_msg: "BOOT STATEMENT IS SET FOR ALL MEMBER SWITCHES"
Thanks,
Vikram
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/ca771e91-0440-4a43-bf05-8bf9665e71efn%40googlegroups.com.