Thanks, but that doesn't work.

E.g.: I used this slightly tweaked line:

- "{{ (ansible_distribution_major_version == 
'12')|ternary('silversearcher-ag', '') }}"

and if the condition is not true, then I get:

TASK: [Install apt packages] 
**************************************************
failed: [mt1-dummys101] => 
(item=build-essential,libyaml-dev,python2.7-dev,) => {"failed": true, 
"item": "build-essential,libyaml-dev,python2.7-dev,"}
msg: No package matching '' is available

It seems that for this kind of thing to work, there would either need to be:

- a way to tell with_items to not add the item at all (by using "omit" 
perhaps, which doesn't currently work in this context)
- "apt" module would ignore a blank string or other sentinel value like 
"omit".

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1491ecf8-2971-4c8b-a0c9-df00e6e32ea5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to