I am trying to split the variable based on delimiter. How can I achieve it?
some_module: {{item}}.split('@')[1]
with_items:
- git@someversionxxx
- gradle@someversionxxx
I get following error:
list object' has no attribute 'split ansible
I want to consider only first part of variable i.e. before '@'
some_module: "{{ item.split('@')[0] }}"
{{ ... }} is used to indicate Jinja2 expressions and everything you have is a Jinja2 expression{ (unless it was a JSON object, here it's not)split result will have an index of 0If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With