Skip to content

Instantly share code, notes, and snippets.

@tbondarchuk
Created September 29, 2016 09:37
Show Gist options
  • Select an option

  • Save tbondarchuk/e32a7296dda81438e56fff01d95d669b to your computer and use it in GitHub Desktop.

Select an option

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

vrej-ab commented Nov 24, 2020

Copy link
Copy Markdown

Great job, thank you so much.

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