foreman_host – Manage Foreman hosts

Synopsis

  • Manage Foreman host Entities

  • This beta version can create and delete hosts from preexisting host groups

Requirements

The below requirements are needed on the host that executes this module.

  • apypie

Parameters

Parameter Choices/Defaults Comments
build
boolean
    Choices:
  • no
  • yes
Whether or not to setup build context for the host
compute_profile
string
Compute profile name
compute_resource
string
Compute resource name
domain
string
Domain name
enabled
boolean
    Choices:
  • no
  • yes
Include this host within Foreman reporting
hostgroup
string
Name of related hostgroup.
Required if state=present and (managed=true or build=true)
location
string
Name of related location
managed
boolean
    Choices:
  • no
  • yes
Whether a host is managed or unmanaged.
Forced to true when build=true
name
string / required
Fully Qualified Domain Name of host
organization
string
Name of related organization
password
string / required
Password of the user accessing the Foreman server
server_url
string / required
URL of the Foreman server
state
string
    Choices:
  • present ←
  • absent
State of the entity in Foreman
subnet
string
IPv4 Subnet name
subnet6
string
IPv6 Subnet name
username
string / required
Username accessing the Foreman server
validate_certs
boolean
    Choices:
  • no
  • yes ←
Whether or not to verify the TLS certificates of the Foreman server

aliases: verify_ssl

Examples

- name: "Create a host"
  foreman_host:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "new_host"
    hostgroup: my_hostgroup
    state: present

- name: "Create a host with build context"
  foreman_host:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "new_host"
    hostgroup: my_hostgroup
    build: true
    state: present

- name: "Create an unmanaged host"
  foreman_host:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "new_host"
    managed: false
    state: present

- name: "Delete a host"
  foreman_host:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "new_host"
    state: absent

Status

Authors

  • Bernhard Hopfenmueller (@Fobhep) ATIX AG

Hint

If you notice any issues in this documentation, you can edit this document to improve it.