theforeman.foreman.registration_command module – Manage Registration Command
Note
This module is part of the theforeman.foreman collection (version 5.7.0).
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.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: theforeman.foreman.registration_command.
New in theforeman.foreman 4.0.0
Synopsis
Manage Registration Command
Requirements
The below requirements are needed on the host that executes this module.
requests
Parameters
Parameter  | 
Comments  | 
|---|---|
Activation keys for subscription-manager client, required for CentOS and Red Hat Enterprise Linux. Required only if host group has no activation keys.  | 
|
PEM formatted file that contains a CA certificate to be used for validation. If the value is not specified in the task, the value of environment variable   | 
|
Clear any previous registration and run  Choices: 
  | 
|
Host group to register the host in.  | 
|
Ignore  Choices: 
  | 
|
Enable insecure argument for the initial  Choices: 
  | 
|
Expiration of the authorization token (in hours).  | 
|
Lifecycle environment for the host. Deprecated: The Lifecycle Environment of a Host should be set by the Activation Key. Removed from the API since Katello 4.12.  | 
|
Location to register the host in.  | 
|
Operating System to register the host in. Operating system must have a   | 
|
Organization to register the host in.  | 
|
Packages to install on the host when registered. Multiple packages are to be given as a space delimited string.  | 
|
Password of the user accessing the Foreman server. If the value is not specified in the task, the value of environment variable   | 
|
Identifier of the Host interface for Remote execution.  | 
|
Repository URL (yum/dnf) or full sources.list entry (apt).  | 
|
URL of the GPG key for the repository.  | 
|
URL of the Foreman server. If the value is not specified in the task, the value of environment variable   | 
|
If this is set to  Choices: 
  | 
|
If this is set to true, SSH keys will be installed on the host. Choices: 
  | 
|
If this is set to true, pull provider client will be deployed on the host. Choices: 
  | 
|
Name of Smart Proxy. This Proxy must have both the   | 
|
Update all packages on the host. Choices: 
  | 
|
Use GSSAPI to perform the authentication, typically this is for Kerberos or Kerberos through Negotiate authentication. Requires the Python library requests-gssapi to be installed. If the value is not specified in the task, the value of environment variable  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: 
  | 
Attributes
Attribute  | 
Support  | 
Description  | 
|---|---|---|
Support: full  | 
Can run in check_mode and return changed status prediction without modifying the entity  | 
|
Support: full  | 
Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode  | 
Examples
# This needs to run on a host with API access
- name: "Generate registration command"
  theforeman.foreman.registration_command:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
  register: command
  delegate_to: localhost
# This needs to run on the host being registered
- name: "Perform registration"
  ansible.builtin.shell:
    cmd: "{{ command.registration_command }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key  | 
Description  | 
|---|---|
The generated registration command. Returned: success  |