foreman_search_facts – Gather facts about Foreman resources¶
Parameters¶
Parameter | Choices/Defaults | Comments |
---|---|---|
full_details
boolean
|
|
If
True all details about the found resources are returnedaliases: info |
password
string
/ required
|
Password of the user accessing the Foreman server
|
|
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
|
|
username
string
/ required
|
Username accessing the Foreman server
|
|
validate_certs
boolean
|
|
Whether or not to verify the TLS certificates of the Foreman server
aliases: verify_ssl |
Examples¶
- name: "Read a Setting"
foreman_search_facts:
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
resource: settings
search: name = http_proxy
register: result
- debug:
var: result.resources[0].value
- name: "Read all Registries"
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
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
resources
list
|
always |
Search results from Foreman
|
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]
Authors¶
Sean O’Keeffe (@sean797)
Hint
If you notice any issues in this documentation you can edit this document to improve it.