Skip to content

Instantly share code, notes, and snippets.

@xbalaji
Created March 24, 2018 03:17
Show Gist options
  • Save xbalaji/89e8bbb39968af734650139876a5f8df to your computer and use it in GitHub Desktop.
Save xbalaji/89e8bbb39968af734650139876a5f8df to your computer and use it in GitHub Desktop.
ansible-getfacts
---
#
# Filename : getfacts.yml
# Date : 15 Dec 2017
# Author : Balaji Venkataraman ([email protected])
# Description : get facts about hosts
#
# Usage:
# run this playbook against specific host(s) as follows:
#
# ansible-playbook -i "decdappgenlc347," --ask-vault-pass getfacts.yml
#
- name: get the facts about a server
hosts: all
vars:
ansible_ssh_user: root
ansible_ssh_pass: "XXXXXX"
tasks:
- name: print gathered facts
debug:
msg:
- "{{ hostvars[inventory_hostname] }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment