Hello,
I'm looking into using set_factmodule for something, but the documentation is
very brief and leaves me with various unanswered questions. My attempts to peek
into the source codedon't answer these - the source of set_fact.py seems
ratherminimal too, anddoesn't enlightenme at all.
Here iswhat I am wondering. Of course I could probably determine the answers to
these questions by experiment, butI'm sure the author of the module might be
able to clarify these things faster and more definitively than I could, and the
modules' documentation would ideally contain the answers(or references to them).
- Can Iset namespaced facts? i.e. some.thing.with.periods
- If so, can I create list elements? i.e. something.a_list.3 ? If so, what
would elements 0, 1,and 2 become?
- Can I set complex values? i.e. assign a datastructure like { x: 1, y: 2 } to
some variable?
- Can I change existing facts? (Both ones it has set and ones set elsewhere.)
Delete them? If not, what happens if I try?
- Presumably all facts it sets are accessible in the
hostvars[inventory_hostname] namespace? (Since these are facts, this is implied
but not explicit, and I wonder if they might be in their own namespace to avoid
tangling with existing facts.)
- Canthe phrase "survive between plays" be clarified? This could mean merely
that the facts endure to the end of the execution of a playbook, but I would
have been surprised if they didn't, and the possibility that they might not
makes me wonder if registered variables and those set by modules return values
don't. The docs don't say anything about a registered variable's lifespan:
http://docs.ansible.com/playbooks_variables.html.
I'm hoping set_fact facts are thereby meant to be more permanent, i.e. between
playbook runs like traditional facts (which would imply some sort of
persistence, perhaps to /etc/ansible/facts.d, although I see those facts are
restricted to an ansible_local namespace).
Thanks
N
--
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].
For more options, visit https://groups.google.com/groups/opt_out.