Skip to content

Instantly share code, notes, and snippets.

@tbondarchuk
Created September 29, 2016 09:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbondarchuk/e32a7296dda81438e56fff01d95d669b to your computer and use it in GitHub Desktop.
Save tbondarchuk/e32a7296dda81438e56fff01d95d669b to your computer and use it in GitHub Desktop.
ansible gather facts from another host
---
## works only on ansible >= 2.0
###### inventory:
# [group1]
# test-01
# [group2]
# test-02
- hosts: group2
tasks:
- name: Gather facts
setup:
delegate_to: "{{ item }}"
delegate_facts: True
with_items: "{{ groups['group1'] }}"
- name: Show facts
debug:
msg: "{{ hostvars['test-01'] }}"
@vrej-ab
Copy link

vrej-ab commented Nov 24, 2020

Great job, thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment