theforeman / theforeman.foreman / 0.8.1 / module / foreman_search_facts Gather facts about Foreman resources Authors: Sean O'Keeffe (@sean797) preview | supported by communitytheforeman.foreman.foreman_search_facts (0.8.1) — module
Install with ansible-galaxy collection install theforeman.foreman:==0.8.1
collections: - name: theforeman.foreman version: 0.8.1
Gather facts about Foreman resources
- name: "Read a Setting" foreman_search_facts: 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 (Katello)" foreman_search_facts: 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" foreman_search_facts: 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 (Katello) foreman_search_facts: 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 (Katello) foreman_search_facts: 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 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 required: true type: str server_url: description: URL of the Foreman server 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: aliases: - verify_ssl default: true description: Whether or not to verify the TLS certificates of the Foreman server type: bool
resources: description: Search results from Foreman returned: always type: list