theforeman / theforeman.foreman / 4.0.0 / module / resource_info Gather information about resources | "added in version" 1.0.0 of theforeman.foreman" Authors: Sean O'Keeffe (@sean797)theforeman.foreman.resource_info (4.0.0) — module
Install with ansible-galaxy collection install theforeman.foreman:==4.0.0
collections: - name: theforeman.foreman version: 4.0.0
Gather information about resources
- 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
params: description: - Add parameters to the API call if necessary - If not specified, no additional parameters are passed type: dict search: description: - Search query to use - If None, all resources are returned type: str password: description: - Password of the user accessing the Foreman server. - If the value is not specified in the task, the value of environment variable C(FOREMAN_PASSWORD) will be used instead. required: true type: str resource: description: - Resource to search - Set to an invalid choice like I(foo) see all available options. required: true type: str username: description: - Username accessing the Foreman server. - If the value is not specified in the task, the value of environment variable C(FOREMAN_USERNAME) will be used instead. required: true type: str server_url: description: - URL of the Foreman server. - If the value is not specified in the task, the value of environment variable C(FOREMAN_SERVER_URL) will be used instead. required: true type: str full_details: aliases: - info default: false description: - If C(True) all details about the found resources are returned type: bool organization: description: - Scope the searched resource by organization type: str validate_certs: default: true description: - 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 C(FOREMAN_VALIDATE_CERTS) will be used instead. type: bool
resources: description: Resource information returned: always type: list