.. Document meta :orphan: .. Anchors .. _ansible_collections.theforeman.foreman.resource_info_module: .. Anchors: short name for ansible.builtin .. Anchors: aliases .. Title theforeman.foreman.resource_info -- Gather information about resources ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. Collection note .. note:: This plugin is part of the `theforeman.foreman collection `_ (version 2.1.2). To install it use: :code:`ansible-galaxy collection install theforeman.foreman`. To use it in a playbook, specify: :code:`theforeman.foreman.resource_info`. .. version_added .. versionadded:: 1.0.0 of theforeman.foreman .. contents:: :local: :depth: 1 .. Deprecated Synopsis -------- .. Description - Gather information about resources .. Aliases .. Requirements Requirements ------------ The below requirements are needed on the host that executes this module. - requests .. Options Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
full_details
boolean
    Choices:
  • no ←
  • yes
If True all details about the found resources are returned

aliases: info
organization
string
Scope the searched resource by organization
params
dictionary
Add parameters to the API call if necessary
If not specified, no additional parameters are passed
password
string / required
Password of the user accessing the Foreman server.
If the value is not specified in the task, the value of environment variable FOREMAN_PASSWORD will be used instead.
resource
string / required
Resource to search
Set to an invalid choice like foo see all available options.
search
string
Search query to use
If None, all resources are returned
server_url
string / required
URL of the Foreman server.
If the value is not specified in the task, the value of environment variable FOREMAN_SERVER_URL will be used instead.
username
string / required
Username accessing the Foreman server.
If the value is not specified in the task, the value of environment variable FOREMAN_USERNAME will be used instead.
validate_certs
boolean
    Choices:
  • no
  • yes ←
Whether or not to verify the TLS certificates of the Foreman server.
If the value is not specified in the task, the value of environment variable FOREMAN_VALIDATE_CERTS will be used instead.

.. Notes Notes ----- .. note:: - Some resources don't support scoping and will return errors when you pass *organization* or unknown data in *params*. .. Seealso .. Examples Examples -------- .. code-block:: yaml+jinja - name: "Read a Setting" theforeman.foreman.resource_info: username: "admin" password: "changeme" server_url: "https://foreman.example.com" resource: settings search: name = foreman_url register: result - debug: var: result.resources[0].value - name: "Read all Registries" theforeman.foreman.resource_info: username: "admin" password: "changeme" server_url: "https://foreman.example.com" resource: registries register: result - debug: var: item.name with_items: "{{ result.resources }}" - name: "Read all Organizations with full details" theforeman.foreman.resource_info: username: "admin" password: "changeme" server_url: "https://foreman.example.com" resource: organizations full_details: true register: result - debug: var: result.resources - name: Get all existing subscriptions for organization with id 1 theforeman.foreman.resource_info: username: "admin" password: "changeme" server_url: "https://foreman.example.com" resource: subscriptions params: organization_id: 1 register: result - debug: var: result - name: Get all existing activation keys for organization ACME theforeman.foreman.resource_info: username: "admin" password: "changeme" server_url: "https://foreman.example.com" resource: activation_keys organization: ACME register: result - debug: var: result .. Facts .. Return values Return Values ------------- Common return values are documented :ref:`here `, the following are the fields unique to this module: .. raw:: html
Key Returned Description
resources
list / elements=string
always
Resource information



.. Status (Presently only deprecated) .. Authors Authors ~~~~~~~ - Sean O'Keeffe (@sean797) .. Parsing errors