theforeman.foreman.smart_class_parameter – Manage Smart Class Parameters
Note
This plugin is part of the theforeman.foreman collection (version 2.2.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install theforeman.foreman
.
To use it in a playbook, specify: theforeman.foreman.smart_class_parameter
.
New in version 1.0.0: of theforeman.foreman
Synopsis
Update Smart Class Parameters.
Smart Class Parameters are created/deleted for Puppet classes during import and cannot be created or deleted otherwise.
Parameters
Parameter |
Comments |
---|---|
Remove duplicate values (only array type) Choices:
|
|
Value to use by default. |
|
Description of the Smart Class Parameter |
|
When enabled the parameter is hidden in the UI. Choices:
|
|
Include default value when merging all matching values. Choices:
|
|
Merge all matching values (only array/hash type). Choices:
|
|
Don’t send this parameter in classification output. Puppet will use the value defined in the Puppet manifest for this parameter. Choices:
|
|
Whether the smart class parameter value is managed by Foreman Choices:
|
|
The order in which values are resolved. |
|
Value overrides |
|
Override match |
|
Don’t send this parameter in classification output, replaces use_puppet_default. Choices:
|
|
Override value, required if omit is false |
|
Name of the parameter |
|
Types of variable values. If Choices:
|
|
Password of the user accessing the Foreman server. If the value is not specified in the task, the value of environment variable |
|
Name of the puppetclass that own the parameter |
|
If true, will raise an error if there is no default value and no matcher provide a value. Choices:
|
|
URL of the Foreman server. If the value is not specified in the task, the value of environment variable |
|
State of the entity. Choices:
|
|
Username accessing the Foreman server. If the value is not specified in the task, the value of environment variable |
|
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 Choices:
|
|
Used to enforce certain values for the parameter values. |
|
Types of validation values. Choices:
|
Examples
- name: "Update prometheus::server alertmanagers_config param default value"
theforeman.foreman.smart_class_parameter:
puppetclass_name: "prometheus::server"
parameter: alertmanagers_config
override: true
required: true
default_value: /etc/prometheus/alert.yml
server_url: "https://foreman.example.com"
username: "admin"
password: "changeme"
state: present
- name: "Update prometheus::server alertmanagers_config param default value"
theforeman.foreman.smart_class_parameter:
puppetclass_name: "prometheus::server"
parameter: alertmanagers_config
override: true
override_value_order:
- fqdn
- hostgroup
- domain
required: true
default_value: /etc/prometheus/alert.yml
server_url: "https://foreman.example.com"
username: "admin"
password: "changeme"
override_values:
- match: domain=example.com
value: foo
- match: domain=foo.example.com
omit: true
state: present
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Final state of the affected entities grouped by their type. Returned: success |
|
List of smart class parameters. Returned: success |
Authors
Baptiste Agasse (@bagasse)