Debian Codegraph @

lib/ansible/modules/gather_facts.py

raw
1 # -*- coding: utf-8 -*-
2 # Copyright: Contributors to the Ansible project
3 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
5 from __future__ import annotations
6
7
8 DOCUMENTATION = """
9 ---
10 module: gather_facts
11 version_added: 2.8
12 short_description: Gathers facts about remote hosts
13 extends_documentation_fragment:
14 - action_common_attributes
15 - action_common_attributes.facts
16 - action_common_attributes.flow
17 description:
18 - This module takes care of executing the R(configured facts modules,FACTS_MODULES), the default is to use the M(ansible.builtin.setup) module.
19 - This module is automatically called by playbooks to gather useful variables about remote hosts that can be used in playbooks.
20 - It can also be executed directly by C(/usr/bin/ansible) to check what variables are available to a host.
21 - Ansible provides many I(facts) about the system, automatically.
22 options:
23 parallel:
24 description:
25 - A toggle that controls if the fact modules are executed in parallel or serially and in order.
26 This can guarantee the merge order of module facts at the expense of performance.
27 - By default it will be true if more than one fact module is used.
28 - For low cost/delay fact modules parallelism overhead might end up meaning the whole process takes longer.
29 Test your specific case to see if it is a speed improvement or not.
30 - The C(ansible_facts_parallel) variable can be used to set this option,
31 overriding the default, but not the direct assignment of the option in the task.
32 type: bool
33 attributes:
34 action:
35 support: full
36 async:
37 details: while this action does not support the task 'async' keywords it can do its own parallel processing using the O(parallel) option.
38 support: none
39 bypass_host_loop:
40 support: none
41 check_mode:
42 details: since this action should just query the target system info it always runs in check mode
43 support: full
44 diff_mode:
45 support: none
46 facts:
47 support: full
48 platform:
49 details: The action plugin should be able to automatically select the specific platform modules automatically or can be configured manually
50 platforms: all
51 notes:
52 - This is mostly a wrapper around other fact gathering modules.
53 - Options passed into this action must be supported by all the underlying fact modules configured.
54 - If using O(ignore:gather_timeout) and parallel execution, it will limit the total execution time of
55 modules that do not accept O(ignore:gather_timeout) themselves.
56 - Facts returned by each module will be merged, conflicts will favor 'last merged'.
57 Order is not guaranteed, when doing parallel gathering on multiple modules.
58 author:
59 - "Ansible Core Team"
60 """
61
62 RETURN = """
63 # depends on the fact module called
64 """
65
66 EXAMPLES = """
67 # Display facts from all hosts and store them indexed by hostname at /tmp/facts.
68 # ansible all -m ansible.builtin.gather_facts --tree /tmp/facts
69 """