On Wed, 5 Feb 2020 03:52:22 -0800 (PST)
Rakesh Parida <
rakeshp...@gmail.com> wrote:
> [...]
> with_items:
> - "{{ dp_record | default(None) }}"
> - "{{ iampython_record | default(None) }}"
> - "{{ iamservice_record | default(None) }}"
> - "{{ iamesa_record | default(None) }}"
>
> But when the "iamesa_record" is not present i get the following list Output:
> "msg": [
> "dp-steps-common",
> "iam-python-common",
> "iam-service-default",
> "None"
> ],
>
> IS there any way that if the item is not available then it should not be
> appended to the list.
Yes. Test the "item". For example
with_items:
- "{{ dp_record | default(None) }}"
- "{{ iampython_record | default(None) }}"
- "{{ iamservice_record | default(None) }}"
- "{{ iamesa_record | default(None) }}"
when: item
I've removed the irrelevant regex_replace part of the filters.
HTH,
-vlado