community.general.stacki_host module – Add or remove host to stacki front-end

Note

This module is part of the community.general collection (version 9.4.0).

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 community.general.

To use it in a playbook, specify: community.general.stacki_host.

Synopsis

Parameters

Parameter

Comments

appliance

string

Appliance to be used in host creation.

Required if state=present and host does not yet exist.

Default: "backend"

force_install

boolean

Set value to true to force node into install state if it already exists in stacki.

Choices:

  • false ← (default)

  • true

name

string / required

Name of the host to be added to Stacki.

network

string

Network to be configured in the host.

Currently not used by the module.

Default: "private"

prim_intf

string

Name of the primary network interface.

Currently not used by the module.

prim_intf_ip

string

IP Address for the primary network interface.

Currently not used by the module.

prim_intf_mac

string

MAC Address for the primary PXE boot network interface.

Currently not used by the module.

rack

integer

Rack to be used in host creation.

Required if state=present and host does not yet exist.

Default: 0

rank

integer

Rank to be used in host creation.

In Stacki terminology, the rank is the position of the machine in a rack.

Required if state=present and host does not yet exist.

Default: 0

stacki_endpoint

string / required

URL for the Stacki API Endpoint.

stacki_password

string / required

Password for authenticating with Stacki API, but if not specified, the environment variable stacki_password is used instead.

stacki_user

string / required

Username for authenticating with Stacki API, but if not specified, the environment variable stacki_user is used instead.

state

string

Set value to the desired state for the specified host.

Choices:

  • "absent"

  • "present" ← (default)

Attributes

Attribute

Support

Description

check_mode

Support: none

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

- name: Add a host named test-1
  community.general.stacki_host:
    name: test-1
    stacki_user: usr
    stacki_password: pwd
    stacki_endpoint: url
    prim_intf_mac: mac_addr
    prim_intf_ip: x.x.x.x
    prim_intf: eth0

- name: Remove a host named test-1
  community.general.stacki_host:
    name: test-1
    stacki_user: usr
    stacki_password: pwd
    stacki_endpoint: url
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

changed

boolean

response to whether or not the api call completed successfully

Returned: always

Sample: true

stdout

list / elements=string

the set of responses from the commands

Returned: always

Sample: ["...", "..."]

stdout_lines

list / elements=string

the value of stdout split into a list

Returned: always

Sample: [["...", "..."], ["..."], ["..."]]

Authors

  • Hugh Ma (@bbyhuy)