Created
March 24, 2018 03:17
-
-
Save xbalaji/89e8bbb39968af734650139876a5f8df to your computer and use it in GitHub Desktop.
ansible-getfacts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# | |
# 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