Thanks for the response Brian
So far I have changed the syntax to the following: (Had to wrap the
version_no == 12 in ( ) to supress `False` passing through.
lib_dir_version: "{{ (version_no == 12)| ternary('12','11') }}"
If I enter 11 in my prompt - I get the expected echo of
echo "My lib dir version is 11."
However when I rerun the playbook, and specify 12 as the version number in
my prompt, I still get Version 11 in the output.
echo "My lib dir version is 11."
Kind Regards
Chris
On Friday, 2 October 2015 00:23:18 UTC+1, Brian Coca wrote:
>
> you are misunderstanding the docs, the use of variables IN the
> conditional 'when' not using when to make var assignment conditional,
> for that you can use filters:
>
> vars:
> lib_dir_version: "{{ version_no == 12|ternary(12, 11) }}"
>
>
>
> --
> 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/2405c801-d22f-4dc0-a7df-f0d6cf316d01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.