I'm currently having a var in my ./vars/default.yml, which is used at 
several points in my playbook for branching installation operations.

boolean_var: true

Depending on this I'm performing (or not) install steps

....
when: not boolean_var

So far so good. I'm also using this var in some j2 templates like so:

{% if boolean_var %}
...
{% endif %}

My problem is, that I mostly forget to set this variable to a proper state, 
which reflects the real status on the host system, so I have to abort an 
update.
I would rather like to derive it from a pre_task, checking the existence of 
a particular file on the host before starting all operations.

Is there a way to define a variable with the same scope (playbook and 
templates) at runtime?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5da6e38e-ae18-4b28-98f9-4341465c2cbfn%40googlegroups.com.

Reply via email to