foreman_host – Manage Foreman hosts¶
Synopsis¶
Manage Foreman host Entities
This beta version can create and delete hosts from preexisting host groups
Parameters¶
Parameter | Choices/Defaults | Comments | |
---|---|---|---|
build
boolean
|
|
Whether or not to setup build context for the host
|
|
comment
string
|
Comment about the host.
|
||
compute_profile
string
|
Compute profile name
|
||
compute_resource
string
|
Compute resource name
|
||
domain
string
|
Domain name
|
||
enabled
boolean
|
|
Include this host within Foreman reporting
|
|
hostgroup
string
|
Name of related hostgroup.
Required if state=present and (managed=true or build=true)
|
||
ip
string
|
IP address of the primary interface of the host.
|
||
location
string
|
Name of related location
|
||
mac
string
|
MAC address of the primary interface of the host.
Please include leading zeros and separate nibbles by colons, otherwise the execution will not be idempotent.
Example EE:BB:01:02:03:04
|
||
managed
boolean
|
|
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
|
||
owner
string
|
Owner (user) of the host.
Mutually exclusive with owner_group.
|
||
owner_group
string
|
Owner (user group) of the host.
Mutually excluside with owner.
|
||
parameters
list
/ elements=dictionary
|
Entity domain specific host parameters
|
||
name
string
/ required
|
Name of the parameter
|
||
parameter_type
string
|
|
Type of the parameter
|
|
value
raw
/ required
|
Value of the parameter
|
||
password
string
/ required
|
Password of the user accessing the Foreman server
|
||
root_pass
string
|
Root password.
Will result in the entity always being updated, as the current password cannot be retrieved.
|
||
server_url
string
/ required
|
URL of the Foreman server
|
||
state
string
|
|
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
|
|
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¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]
Authors¶
Bernhard Hopfenmueller (@Fobhep) ATIX AG
Hint
If you notice any issues in this documentation, you can edit this document to improve it.