How could I omit parameter in lookup when it isn't defined?
I have tried with something like default(omit)
, but it doesn't work:
- set_fact:
myvar: >-
{{ query(
'awx.awx.schedule_rrule',
'minute',
start_date=item.start_date | default(omit)
) }}
This errors with:
fatal: [localhost]: FAILED! =>
msg: 'An unhandled exception occurred while running the lookup plugin ''awx.awx.schedule_rrule''. Error was a <class ''ansible.errors.AnsibleError''>, original message: Parameter start_date must be in the format YYYY-MM-DD [HH:MM:SS]. Parameter start_date must be in the format YYYY-MM-DD [HH:MM:SS]'