Hi,

Sorry to dig up this thread again but it's also an issue for me.

AIUI, Strahinja Kustudić needs (just as I do) a way to always gather facts 
on all hosts, regardless of tags/limits. What your proposal does is (again, 
AIUI) improve performance without the need of gather_facts: false in every 
play. It's cool but different. We need different functionality, not better 
performance.

Consider:

---
- hosts: vpn_clients
  gather_facts: force
  tasks:
  - apt: pkg=openvpn-or-whatever

- hosts: vpn_hub
  tasks:
  - template: src=uses_facts_from_vpn_clients.j2

I'd love this playbook to do exactly the same thing on vpn_hub when ran 
with -l vpn_hub and without. Otherwise whenever I want to simply regenerate 
the vpn_hub's config, I'll either reconfigure all the clients again (time 
consuming), generate a totally broken config (no clients' facts on hub), or 
write a separate top-level playbook just for this one single task (not DRY 
and/or ravioli code).

FWIW, I'm totally fine with calling setup manually on these hosts, so maybe 
something like the following would be better? I'm willing to implement 
anything that stands a chance of being accepted.

- hosts: vpn_clients
  tasks:
  - setup:
    ignore_tags: true
    ignore_limit: true
  - apt: pkg=openvpn-or-whatever

- hosts: vpn_hub
  tasks:
  - template: src=uses_facts_from_vpn_clients.j2

Or make the ignore_* attributes of the play instead of a particular task if 
that makes anything easier.

All comments appreciated.

Best regards,
 Grzegorz Nosek

W dniu piątek, 14 marca 2014 17:42:26 UTC+1 użytkownik Michael DeHaan 
napisał:
>
> We've discussed this and what we want to do with gather_facts is make a 
> config setting
>
> gather_facts_tendancy:  always or lazy, default always
>
> and then if you want to force when it's lazy, you could just call the '- 
> setup' module in the tasks section.
>
>
>
>
>
> On Fri, Mar 14, 2014 at 12:28 PM, Strahinja Kustudić 
> <[email protected]<javascript:>
> > wrote:
>
>> I know this is now and old topic, but it didn't make sense to open a new 
>> one.
>>
>> Having offline cache would be nice, but wouldn't be easier to make 
>> something like:
>>
>> *gather_facts: force* or *gather_facts_**force: True*
>>
>> or something similar, so that this overrides --limit / --tags and always 
>> gathers facts.
>>
>>

-- 
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/83bb88e8-d4dd-42d9-abab-2ca0bea64c4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to