You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bigip_command wait_for parameter is not well documented
STEPS TO REPRODUCE
The following task is working well, but I wanted to add conditions to like split text and only compare second word in output first line.
- name: Wait for active or standby status (means online)
bigip_command:
commands:
- show sys failover
provider: "{{ bigip_provider }}"
warn: no
match: any
wait_for:
- result[0] contains 'Failover active'
- result[0] contains 'Failover standby'
retries: 60
interval: 30
register: sys_failover_state
After multiple tests, I discovered that wait_for 'result' is an internal bigip_command variable and is not the same as defined in register attribute.
According to the example above and the clouddocs documentation, I was expecting that wait_for conditions use sys_failover_state variable and not result
I tried to change contains operator with equals, in... but not other operator I tried works. What operators are supported? can we split output to compare second word?
EXPECTED RESULTS
I was expecting to use filter like:
- sys_failover_state.stdout_lines.0.0.split()[1] in ['active','standby']
The text was updated successfully, but these errors were encountered:
stanislaspiron
added
bug
Issues that are related to bugs in the Ansible modules
untriaged
issue that needs an initial response from the developers
labels
Nov 2, 2023
Thanks for reporting. Added to the backlog and internal tracking ID for this request is: INFRAANO-1360.
pgouband
added
backlog
Item logged internally
and removed
bug
Issues that are related to bugs in the Ansible modules
untriaged
issue that needs an initial response from the developers
labels
Nov 3, 2023
The wait_for parameter uses ansible.netcommon Conditional function which has implemented a number of operators that are allowed to be used. You can see them here in the source:
When it comes to using result keyword, this looks like implementation issue, i have raised a question/bug report with ansible: ansible-collections/ansible.netcommon#601
For now you need to use result in wait_for condition, you do not need to register the output to result, for me the below works:
- name: Wait for active or standby status (means online)
bigip_command:
commands:
- show sys failover
wait_for:
- result[0] contains 'Failover active'
provider: "{{ f5_provider }}"
warn: no
match: any
retries: 60
interval: 30
register: sys_failover_state
COMPONENT NAME
Environment
ANSIBLE VERSION
BIGIP VERSION
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
bigip_command wait_for parameter is not well documented
STEPS TO REPRODUCE
The following task is working well, but I wanted to add conditions to like split text and only compare second word in output first line.
After multiple tests, I discovered that wait_for 'result' is an internal bigip_command variable and is not the same as defined in register attribute.
According to the example above and the clouddocs documentation, I was expecting that wait_for conditions use sys_failover_state variable and not result
I tried to change contains operator with equals, in... but not other operator I tried works. What operators are supported? can we split output to compare second word?
EXPECTED RESULTS
I was expecting to use filter like:
The text was updated successfully, but these errors were encountered: