theforeman.foreman.os_default_template (4.0.0) — module

Manage Default Template Associations To Operating Systems

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

Authors: Matthias M Dellweg (@mdellweg) ATIX AG

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 OSDefaultTemplate Entities


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Create an Association"
  theforeman.foreman.os_default_template:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    operatingsystem: "CoolOS"
    template_kind: "finish"
    provisioning_template: "CoolOS finish"
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Delete an Association"
  theforeman.foreman.os_default_template:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    operatingsystem: "CoolOS"
    template_kind: "finish"
    state: absent

Inputs

    
state:
    choices:
    - present
    - present_with_defaults
    - absent
    default: present
    description:
    - State of the entity
    - C(present_with_defaults) will ensure the entity exists, but won't update existing
      ones
    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

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

template_kind:
    choices:
    - Bootdisk
    - cloud-init
    - finish
    - host_init_config
    - iPXE
    - job_template
    - kexec
    - POAP
    - provision
    - PXEGrub
    - PXEGrub2
    - PXELinux
    - registration
    - script
    - user_data
    - ZTP
    description:
    - name of the template kind
    required: true
    type: str

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

operatingsystem:
    description:
    - Operating systems are looked up by their title which is composed as "<name> <major>.<minor>".
    - You can omit the version part as long as you only have one operating system by that
      name.
    required: true
    type: str

provisioning_template:
    description:
    - name of provisioning template
    required: false
    type: str

Outputs

entity:
  contains:
    os_default_templates:
      description: List of operatingsystem default templates.
      elements: dict
      type: list
  description: Final state of the affected entities grouped by their type.
  returned: success
  type: dict