1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Added more examples for the filter option in setup

Added examples covering all available globs
Added a use case of filtering only facts returned by facter
This commit is contained in:
Michel Blanc 2013-02-20 18:13:05 +01:00
parent 5f4a24557b
commit 139e06d9af

View file

@ -52,11 +52,20 @@ notes:
bubbled up to the caller. Using the ansible facts and choosing to not
install I(facter) and I(ohai) means you can avoid Ruby-dependencies on your
remote systems. (See also M(facter) and M(ohai).)
- The filter option filters only the first level subkey below ansible_facts.
examples:
- code: ansible all -m setup --tree /tmp/facts
description: Obtain facts from all hosts and store them indexed by I(hostname) at C(/tmp/facts).
- code: ansible all -m setup -a 'filter=ansible_*_mb'
description: Obtain I(only) facts regarding memory from all hosts and output them.
description: Obtain I(only) facts regarding memory found by ansible on all hosts and output them.
- code: ansible all -m setup -a 'filter=facter_*'
description: Display I(only) facts returned by facter.
- code: ansible all -m setup -a 'filter=ansible_eth[0-2]'
description: Displays ansible facts abouts ethernet interfaces eth0, eth1, and eth2.
- code: ansible all -m setup -a 'filter=ansible_eth?'
description: Displays ansible facts abouts ethernet interfaces eth0 through eth9 (but not eth10).
- code: ansible all -m setup -a 'filter=ansible_eth[!0]'
description: Displays ansible facts abouts all ethernet interfaces but eth0.
author: Michael DeHaan
'''