I am trying to check if a condition is met using the wait_for
argument on a task:
- name: GET SHOW PORT SECURITY INTRUSION OUTPUT
arubanetworks.aos_switch.arubaoss_command:
commands:
- "show port-security intrusion-log | i ^ {{item.Port}} ."
wait_for: result[0] contains ' 1 bc9fe4-c653a4'
register: port_security_intrusion_output
when:
- int_brief_filtred.msg | length > 0
loop: "{{ int_brief_filtred.msg }}"
This way, the playbook will only move to the next task if the condition is met. The problem is: This string will vary, but always following the same pattern.
AWX version: < AWX 21.13.0 > ansible module: arubaoss_command ansible collection: arubanetworks.aos_switch
On the documentations I only found the possibility of evaluating pure strings, not regex.
Is there a wait_for
condition option like this?
wait_for: result[0] matches(\s+......-......)