You are not using |default correctly, the split needs a defined
variable to work on:
with_items: {{ (servicename|default('')).split(',') }}
That still creates a list with single blank item so you might want to
add a defined check
with_items: "{{ (notdefined is
defined)|ternary((notdefined|default('')).split(','),[]) }}"
--
----------
Brian Coca
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CACVha7eXpH_jFVUubtuNY-5bb25XzAE%2B3fvTs3%3DMx%3D-qDDSazA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.