.. Document meta :orphan: .. |antsibull-internal-nbsp| unicode:: 0xA0 :trim: .. role:: ansible-attribute-support-label .. role:: ansible-attribute-support-property .. role:: ansible-attribute-support-full .. role:: ansible-attribute-support-partial .. role:: ansible-attribute-support-none .. role:: ansible-attribute-support-na .. role:: ansible-option-type .. role:: ansible-option-elements .. role:: ansible-option-required .. role:: ansible-option-versionadded .. role:: ansible-option-aliases .. role:: ansible-option-choices .. role:: ansible-option-choices-entry .. role:: ansible-option-default .. role:: ansible-option-default-bold .. role:: ansible-option-configuration .. role:: ansible-option-returned-bold .. role:: ansible-option-sample-bold .. Anchors .. _ansible_collections.redhat.satellite.foreman_inventory: .. Anchors: short name for ansible.builtin .. Anchors: aliases .. Title redhat.satellite.foreman inventory -- Foreman inventory source ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. Collection note .. note:: This inventory plugin is part of the `redhat.satellite collection `_ (version 3.6.0). To install it, use: :code:`ansible-galaxy collection install redhat.satellite`. You need further requirements to be able to use this inventory plugin, see :ref:`Requirements ` for details. To use it in a playbook, specify: :code:`redhat.satellite.foreman`. .. version_added .. contents:: :local: :depth: 1 .. Deprecated Synopsis -------- .. Description - Get inventory hosts from Foreman. - Uses a YAML configuration file that ends with \`\`foreman.(yml|yaml)\`\`. .. Aliases .. Requirements .. _ansible_collections.redhat.satellite.foreman_inventory_requirements: Requirements ------------ The below requirements are needed on the local controller node that executes this inventory. - requests \>= 1.1 .. Options Parameters ---------- .. rst-class:: ansible-option-table .. list-table:: :width: 100% :widths: auto :header-rows: 1 * - Parameter - Comments * - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-batch_size: .. rst-class:: ansible-option-title **batch_size** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`integer` .. raw:: html
- .. raw:: html
Number of hosts per batch that will be retrieved from the Foreman API per individual call .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`250` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-cache: .. rst-class:: ansible-option-title **cache** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle to enable/disable the caching of the inventory's source data, requires a cache plugin setup to work. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-default-bold:`false` :ansible-option-default:`← (default)` - :ansible-option-choices-entry:`true` .. rst-class:: ansible-option-line :ansible-option-configuration:`Configuration:` - INI entry: .. code-block:: [inventory] cache = false - Environment variable: ANSIBLE\_INVENTORY\_CACHE .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-cache_connection: .. rst-class:: ansible-option-title **cache_connection** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Cache connection data or path, read cache plugin documentation for specifics. .. rst-class:: ansible-option-line :ansible-option-configuration:`Configuration:` - INI entries: .. code-block:: [defaults] fact_caching_connection = None .. code-block:: [inventory] cache_connection = None - Environment variable: ANSIBLE\_CACHE\_PLUGIN\_CONNECTION - Environment variable: ANSIBLE\_INVENTORY\_CACHE\_CONNECTION .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-cache_plugin: .. rst-class:: ansible-option-title **cache_plugin** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Cache plugin to use for the inventory's source data. .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`"memory"` .. rst-class:: ansible-option-line :ansible-option-configuration:`Configuration:` - INI entries: .. code-block:: [defaults] fact_caching = memory .. code-block:: [inventory] cache_plugin = memory - Environment variable: ANSIBLE\_CACHE\_PLUGIN - Environment variable: ANSIBLE\_INVENTORY\_CACHE\_PLUGIN .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-cache_prefix: .. rst-class:: ansible-option-title **cache_prefix** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Prefix to use for cache plugin files/tables .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`"ansible\_inventory\_"` .. rst-class:: ansible-option-line :ansible-option-configuration:`Configuration:` - INI entries: .. code-block:: [default] fact_caching_prefix = ansible_inventory_ .. code-block:: [inventory] cache_prefix = ansible_inventory_ - Environment variable: ANSIBLE\_CACHE\_PLUGIN\_PREFIX - Environment variable: ANSIBLE\_INVENTORY\_CACHE\_PLUGIN\_PREFIX .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-cache_timeout: .. rst-class:: ansible-option-title **cache_timeout** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`integer` .. raw:: html
- .. raw:: html
Cache duration in seconds .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`3600` .. rst-class:: ansible-option-line :ansible-option-configuration:`Configuration:` - INI entries: .. code-block:: [defaults] fact_caching_timeout = 3600 .. code-block:: [inventory] cache_timeout = 3600 - Environment variable: ANSIBLE\_CACHE\_PLUGIN\_TIMEOUT - Environment variable: ANSIBLE\_INVENTORY\_CACHE\_TIMEOUT .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-compose: .. rst-class:: ansible-option-title **compose** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`dictionary` .. raw:: html
- .. raw:: html
Create vars from jinja2 expressions. .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`{}` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-foreman: .. rst-class:: ansible-option-title **foreman** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Foreman server related configuration, deprecated. You can pass \ :emphasis:`use\_reports\_api`\ in this dict to enable the Reporting API. Only for backward compatibility. .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-group_prefix: .. rst-class:: ansible-option-title **group_prefix** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
prefix to apply to foreman groups .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`"foreman\_"` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-groups: .. rst-class:: ansible-option-title **groups** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`dictionary` .. raw:: html
- .. raw:: html
Add hosts to group based on Jinja2 conditionals. .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`{}` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-host_filters: .. rst-class:: ansible-option-title **host_filters** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
This can be used to restrict the list of returned host .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-hostnames: .. rst-class:: ansible-option-title **hostnames** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`list` / :ansible-option-elements:`elements=string` .. raw:: html
- .. raw:: html
A list of templates in order of precedence to compose inventory\_hostname. If the template results in an empty string or None value it is ignored. .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`["name"]` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-keyed_groups: .. rst-class:: ansible-option-title **keyed_groups** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`list` / :ansible-option-elements:`elements=string` .. raw:: html
- .. raw:: html
Add hosts to group based on the values of a variable. .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`[]` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-legacy_hostvars: .. rst-class:: ansible-option-title **legacy_hostvars** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle, if true the plugin will build legacy hostvars present in the foreman script Places hostvars in a dictionary with keys \`foreman\`, \`foreman\_facts\`, and \`foreman\_params\` .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-default-bold:`false` :ansible-option-default:`← (default)` - :ansible-option-choices-entry:`true` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-max_timeout: .. rst-class:: ansible-option-title **max_timeout** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`integer` .. raw:: html
- .. raw:: html
Timeout before falling back to old host API when using report\_data endpoint while polling. .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`600` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-password: .. rst-class:: ansible-option-title **password** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` / :ansible-option-required:`required` .. raw:: html
- .. raw:: html
Password of the user accessing the Foreman server. .. rst-class:: ansible-option-line :ansible-option-configuration:`Configuration:` - Environment variable: FOREMAN\_PASSWORD .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-plugin: .. rst-class:: ansible-option-title **plugin** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` / :ansible-option-required:`required` .. raw:: html
- .. raw:: html
token that ensures this is a source file for the \ :literal:`foreman`\ plugin. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`redhat.satellite.foreman` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-poll_interval: .. rst-class:: ansible-option-title **poll_interval** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`integer` .. raw:: html
- .. raw:: html
The polling interval between 2 calls to the report\_data endpoint while polling. .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`10` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-report: .. rst-class:: ansible-option-title **report** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`dictionary` .. raw:: html
- .. raw:: html
Report API specific configuration, deprecated. You can pass the Report API specific params as part of this dict, instead of the main configuration. Only for backward compatibility. .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-strict: .. rst-class:: ansible-option-title **strict** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
If \ :literal:`yes`\ make invalid entries a fatal error, otherwise skip and continue. Since it is possible to use facts in the expressions they might not always be available and we ignore those errors by default. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-default-bold:`false` :ansible-option-default:`← (default)` - :ansible-option-choices-entry:`true` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-url: .. rst-class:: ansible-option-title **url** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
URL of the Foreman server. .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`"http://localhost:3000"` .. rst-class:: ansible-option-line :ansible-option-configuration:`Configuration:` - Environment variable: FOREMAN\_SERVER - Environment variable: FOREMAN\_SERVER\_URL - Environment variable: FOREMAN\_URL .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-use_reports_api: .. rst-class:: ansible-option-title **use_reports_api** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Use Reporting API. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-default-bold:`true` :ansible-option-default:`← (default)` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-user: .. rst-class:: ansible-option-title **user** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` / :ansible-option-required:`required` .. raw:: html
- .. raw:: html
Username accessing the Foreman server. .. rst-class:: ansible-option-line :ansible-option-configuration:`Configuration:` - Environment variable: FOREMAN\_USER - Environment variable: FOREMAN\_USERNAME .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-validate_certs: .. rst-class:: ansible-option-title **validate_certs** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Whether or not to verify the TLS certificates of the Foreman server. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-default-bold:`true` :ansible-option-default:`← (default)` .. rst-class:: ansible-option-line :ansible-option-configuration:`Configuration:` - Environment variable: FOREMAN\_VALIDATE\_CERTS .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-vars_prefix: .. rst-class:: ansible-option-title **vars_prefix** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
prefix to apply to host variables, does not include facts nor params .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`"foreman\_"` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-want_content_facet_attributes: .. rst-class:: ansible-option-title **want_content_facet_attributes** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle, if true the inventory will fetch content view details that the host is tied to. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-default-bold:`true` :ansible-option-default:`← (default)` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-want_facts: .. rst-class:: ansible-option-title **want_facts** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle, if True the plugin will retrieve host facts from the server .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-default-bold:`false` :ansible-option-default:`← (default)` - :ansible-option-choices-entry:`true` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-want_host_group: .. rst-class:: ansible-option-title **want_host_group** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle, if true the inventory will fetch host\_groups and create groupings for the same. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-default-bold:`true` :ansible-option-default:`← (default)` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-want_hostcollections: .. rst-class:: ansible-option-title **want_hostcollections** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle, if true the plugin will create Ansible groups for host collections .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-default-bold:`false` :ansible-option-default:`← (default)` - :ansible-option-choices-entry:`true` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-want_ipv4: .. rst-class:: ansible-option-title **want_ipv4** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle, if true the inventory will fetch ipv4 address of the host. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-default-bold:`true` :ansible-option-default:`← (default)` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-want_ipv6: .. rst-class:: ansible-option-title **want_ipv6** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle, if true the inventory will fetch ipv6 address of the host. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-default-bold:`true` :ansible-option-default:`← (default)` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-want_location: .. rst-class:: ansible-option-title **want_location** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle, if true the inventory will fetch location the host belongs to and create groupings for the same. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-default-bold:`true` :ansible-option-default:`← (default)` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-want_organization: .. rst-class:: ansible-option-title **want_organization** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle, if true the inventory will fetch organization the host belongs to and create groupings for the same. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-default-bold:`true` :ansible-option-default:`← (default)` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-want_params: .. rst-class:: ansible-option-title **want_params** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle, if true the inventory will retrieve 'all\_parameters' information as host vars .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-default-bold:`false` :ansible-option-default:`← (default)` - :ansible-option-choices-entry:`true` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-want_smart_proxies: .. rst-class:: ansible-option-title **want_smart_proxies** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle, if true the inventory will fetch smart proxy that the host is registered to. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-default-bold:`true` :ansible-option-default:`← (default)` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-want_subnet: .. rst-class:: ansible-option-title **want_subnet** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle, if true the inventory will fetch subnet. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-default-bold:`true` :ansible-option-default:`← (default)` .. raw:: html
* - .. raw:: html
.. _ansible_collections.redhat.satellite.foreman_inventory__parameter-want_subnet_v6: .. rst-class:: ansible-option-title **want_subnet_v6** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Toggle, if true the inventory will fetch ipv6 subnet. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-default-bold:`true` :ansible-option-default:`← (default)` .. raw:: html
.. Attributes .. Notes .. Seealso .. Examples Examples -------- .. code-block:: yaml+jinja # my.foreman.yml plugin: redhat.satellite.foreman url: https://satellite.example.com user: ansibleinventory password: changeme host_filters: 'organization="Web Engineering"' # shortname.foreman.yml plugin: redhat.satellite.foreman url: https://satellite.example.com user: ansibleinventory password: changeme hostnames: - name.split('.')[0] .. Facts .. Return values .. Status (Presently only deprecated) .. Authors .. hint:: Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up. .. Extra links Collection links ~~~~~~~~~~~~~~~~ .. raw:: html .. Parsing errors