mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
add a 'min' type for gather_subset to collect nothing (#27085)
previously gather_subset=['!all'] would still gather the min set of facts, and there was no way to collect no facts. The 'min' specifier in gather_subset is equilivent to exclude the minimal_gather_subset facts as well. gather_subset=['!all', '!min'] will collect no facts This also lets explicitly added gather_subsets override excludes. gather_subset=['pkg_mgr', '!all', '!min'] will collect only the pkg_mgr fact.
This commit is contained in:
parent
c85b36d220
commit
27a015f0ad
4 changed files with 172 additions and 36 deletions
|
@ -23,13 +23,16 @@ options:
|
|||
version_added: "2.1"
|
||||
description:
|
||||
- "if supplied, restrict the additional facts collected to the given subset.
|
||||
Possible values: all, hardware, network, virtual, ohai, and
|
||||
Possible values: all, min, hardware, network, virtual, ohai, and
|
||||
facter Can specify a list of values to specify a larger subset.
|
||||
Values can also be used with an initial C(!) to specify that
|
||||
that specific subset should not be collected. For instance:
|
||||
!hardware, !network, !virtual, !ohai, !facter. Note that a few
|
||||
facts are always collected. Use the filter parameter if you do
|
||||
not want to display those."
|
||||
!hardware, !network, !virtual, !ohai, !facter. If !all is specified
|
||||
then only the min subset is collected. To avoid collecting even the
|
||||
min subset, specify !all and !min subsets. To collect only specific facts,
|
||||
use !all, !min, and specify the particular fact subsets.
|
||||
Use the filter parameter if you do not want to display some collected
|
||||
facts."
|
||||
required: false
|
||||
default: 'all'
|
||||
gather_timeout:
|
||||
|
@ -93,18 +96,27 @@ EXAMPLES = """
|
|||
# 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.
|
||||
# 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 minimum amount of facts:
|
||||
# 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'"
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue