theforeman.foreman.registration_command (4.0.0) — module

Manage Registration Command

| "added in version" 4.0.0 of theforeman.foreman"

Authors: Evgeni Golov (@evgeni)

Install collection

Install with ansible-galaxy collection install theforeman.foreman:==4.0.0


Add to requirements.yml

  collections:
    - name: theforeman.foreman
      version: 4.0.0

Description

Manage Registration Command


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Generate registration command"
  theforeman.foreman.registration_command:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
  register: command
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Perform registration"
  ansible.builtin.shell:
    cmd: "{{ command.registration_command }}"

Inputs

    
repo:
    description:
    - Repository URL (yum/dnf) or full sources.list entry (apt).
    required: false
    type: str

force:
    description:
    - Clear any previous registration and run C(subscription-manager) with C(--force).
    required: false
    type: bool

insecure:
    description:
    - Enable insecure argument for the initial C(curl).
    required: false
    type: bool

location:
    description:
    - Location to register the host in.
    required: false
    type: str

packages:
    description:
    - Packages to install on the host when registered.
    - Multiple packages are to be given as a space delimited string.
    required: false
    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

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

hostgroup:
    description:
    - Host group to register the host in.
    required: false
    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

smart_proxy:
    description:
    - Name of Smart Proxy.
    - This Proxy must have both the C(Templates) and C(Registration) features enabled.
    required: false
    type: str

organization:
    description:
    - Organization to register the host in.
    required: false
    type: str

jwt_expiration:
    description:
    - Expiration of the authorization token (in hours).
    required: false
    type: int

setup_insights:
    description:
    - If this is set to C(true), C(insights-client) will be installed and registered on
      Red Hat family operating systems.
    required: false
    type: bool

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

activation_keys:
    description:
    - Activation keys for subscription-manager client, required for CentOS and Red Hat
      Enterprise Linux.
    - Required only if host group has no activation keys.
    elements: str
    required: false
    type: list

operatingsystem:
    description:
    - Operating System to register the host in.
    - Operating system must have a C(host_init_config) template assigned.
    required: false
    type: str

update_packages:
    description:
    - Update all packages on the host.
    required: false
    type: bool

repo_gpg_key_url:
    description:
    - URL of the GPG key for the repository.
    required: false
    type: str

ignore_subman_errors:
    description:
    - Ignore C(subscription-manager) errors for C(subscription-manager register) command.
    required: false
    type: bool

lifecycle_environment:
    description:
    - Lifecycle environment for the host.
    required: false
    type: str

setup_remote_execution:
    description:
    - If this is set to true, SSH keys will be installed on the host.
    required: false
    type: bool

remote_execution_interface:
    description:
    - Identifier of the Host interface for Remote execution.
    required: false
    type: str

setup_remote_execution_pull:
    description:
    - If this is set to true, pull provider client will be deployed on the host.
    required: false
    type: bool

Outputs

registration_command:
  description: The generated registration command.
  returned: success
  type: str