Created
April 12, 2018 13:55
-
-
Save omps/94fa0d1dc13c017429310717d6f2d9ca to your computer and use it in GitHub Desktop.
Collect facts from hosts
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
# Display facts from all hosts and store them indexed by I(hostname) at C(/tmp/facts). | |
# ansible all -m setup --tree /tmp/facts | |
# Display only facts regarding memory found by ansible on all hosts and output them. | |
# ansible all -m setup -a 'filter=ansible_*_mb' | |
# Display only facts returned by facter. | |
# ansible all -m setup -a 'filter=facter_*' | |
# Collect only facts returned by facter. | |
# ansible all -m setup -a 'gather_subset=!all,!any,facter' | |
# Display only facts about certain interfaces. | |
# ansible all -m setup -a 'filter=ansible_eth[0-2]' | |
# Restrict additional gathered facts to network and virtual (includes default minimum facts) | |
# ansible all -m setup -a 'gather_subset=network,virtual' | |
# Collect only network and virtual (excludes default minimum facts) | |
# ansible all -m setup -a 'gather_subset=!all,!any,network,virtual' | |
# Do not call puppet facter or ohai even if present. | |
# ansible all -m setup -a 'gather_subset=!facter,!ohai' | |
# Only collect the default minimum amount of facts: | |
# ansible all -m setup -a 'gather_subset=!all' | |
# Collect no facts, even the default minimum subset of facts: | |
# ansible all -m setup -a 'gather_subset=!all,!min' | |
# Display facts from Windows hosts with custom facts stored in C(C:\custom_facts). | |
# ansible windows -m setup -a "fact_path='c:\custom_facts'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment