According to http://docs.ansible.com/ansible/playbooks_variables.html
" the when conditional can also be used with variables"
However here is my issue with it on ansible-1.9.2-1.
I'm setting a vars_prompt for version number.
When running through it, i'm specifying Version 11.
- name: "version_no"
prompt: "What version of oracle are we setting? 11 or 12. 11 is
default"
default: "11"
private: no
Then an associated variable called lib_dir_version based on the version
entered.
vars:
lib_dir_version: "11.2"
when: "{{version_no}} == 11"
lib_dir_version: "12.1"
when: "{{version_no}} == 12"
However the above always only takes 12.1 as the return when i Echo Out.
tasks:
- name: "Echo dir version"
shell: echo "My lib dir version is {{ lib_dir_version }}."
FROM messages on host.
args=echo "My lib dir version is 12.1." removes=None NO_LOG=None shell=True
warn=True
Why cant i figure this out?
Whats wrong with my syntax?
Chris
--
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/5c881221-d8aa-440e-bdd0-f123665b4bcd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.