redhat.satellite.host – Manage Hosts
Note
This plugin is part of the redhat.satellite collection (version 3.0.0).
You might already have this collection installed if you are using the ansible
package.
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 redhat.satellite
.
To use it in a playbook, specify: redhat.satellite.host
.
New in version 1.0.0: of redhat.satellite
Synopsis
Create, update, and delete Hosts
Requirements
The below requirements are needed on the host that executes this module.
requests
Parameters
Examples
- name: "Create a host"
redhat.satellite.host:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
name: "new_host"
hostgroup: my_hostgroup
state: present
- name: "Create a host with build context"
redhat.satellite.host:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
name: "new_host"
hostgroup: my_hostgroup
build: true
state: present
- name: "Create an unmanaged host"
redhat.satellite.host:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
name: "new_host"
managed: false
state: present
- name: "Create a VM with 2 CPUs and 4GB RAM"
redhat.satellite.host:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
name: "new_host"
compute_attributes:
cpus: 2
memory_mb: 4096
state: present
- name: "Create a VM and start it after creation"
redhat.satellite.host:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
name: "new_host"
compute_attributes:
start: "1"
state: present
- name: "Create a VM on specific ovirt network"
redhat.satellite.host:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
name: "new_host"
interfaces_attributes:
- type: "interface"
compute_attributes:
name: "nic1"
network: "969efbe6-f9e0-4383-a19a-a7ee65ad5007"
interface: "virtio"
state: present
- name: "Create a VM with 2 NICs on specific ovirt networks"
redhat.satellite.host:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
name: "new_host"
interfaces_attributes:
- type: "interface"
primary: true
compute_attributes:
name: "nic1"
network: "969efbe6-f9e0-4383-a19a-a7ee65ad5007"
interface: "virtio"
- type: "interface"
name: "new_host_nic2"
managed: true
compute_attributes:
name: "nic2"
network: "969efbe6-f9e0-4383-a19a-a7ee65ad5008"
interface: "e1000"
state: present
- name: "Delete a host"
redhat.satellite.host:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
name: "new_host"
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description | |
---|---|---|---|
entity
dictionary
|
success |
Final state of the affected entities grouped by their type.
|
|
hosts
list
/ elements=dictionary
|
success |
List of hosts.
|