ansible: gather facts in a task? - Server Fault
serverfault.com › questions › 900163Mar 06, 2018 · delegate_facts. Delegated facts learn facts from some other host, even if that other host wasn't part of the play. Slightly modified from the documentation example play: - hosts: apps tasks: - name: gather facts from apps tags: ['apps'] setup: delegate_to: " { {item}}" delegate_facts: True with_items: " { {groups ['elk']}}" Share.
Ansible - actions BEFORE gathering facts - Stack Overflow
stackoverflow.com › questions › 31054453Jun 25, 2015 · You can manually gather facts by running it. It's not documented, but simply add a task like this: - name: Gathering facts setup: In combination with gather_facts: no on playbook level the facts will only be fetched when above task is executed. Both in an example playbook: - hosts: all gather_facts: no tasks: - name: Some task executed before gathering facts # whatever task you want to run - name: Gathering facts setup: