W dniu 25.03.2014 01:17, Michael DeHaan pisze:
Right, just pointing that out in case the thread had changed scope.
As we have too many fish in the basket right now (mixed metaphors FTW) I
don't think this is going to get stomped anytime soon with respect to
gathering hosts outside the loop.
If time is the only issue, please choose a solution and I'll implement
it. The candidates so far are (Brian, Strahinja, please correct me if I
got something wrong/omitted something):
1.
- hosts: foo
gather_facts: always
Pros: simple syntax, probably does 90% of the job
Cons: no way to support custom fact modules
2.
- hosts: localhost
tasks:
- setup: target={{ item }}
with_inventory_hostnames: foo
Pros: compact (no separate play required just to gather facts)
Cons: probably (relative) hell to implement, custom fact modules have to
reimplement target= by themselves
3.
- hosts: localhost
tasks:
- setup:
delegate_to: "{{ item }}"
delegate_facts: true
with_inventory_hostnames: foo
Pros: transparent wrt. custom facts, probably easy to implement
Cons: increasing line count (also: the variable name?)
4.
- hosts: foo
ignore_tags: true
ignore_limit: true
tasks:
- setup
Pros: doesn't require decorating every task if there are several,
explicit about what happens
Cons: "oh yeah, I lied, tags/limits do not always apply" suprise,
verbose for the 90% use case of just gathering some facts
If I were to decide, I'd go for 1 + 3 to make the easy thing easy (just
gather these facts whatever happens) and the hard thing possible
(explicitly collect custom facts from other hosts even when excluded by
tags/limit)
Best regards,
Grzegorz Nosek
--
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/5331218B.5090409%40gmail.com.
For more options, visit https://groups.google.com/d/optout.