community.general.stacki_host (8.5.0) — module

Add or remove host to stacki front-end

Authors: Hugh Ma (@bbyhuy) <Hugh.Ma@flextronics.com>

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Use this module to add or remove hosts to a stacki front-end via API.

Information on stacki can be found at U(https://github.com/StackIQ/stacki).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
name:
    description:
    - Name of the host to be added to Stacki.
    required: true
    type: str

rack:
    default: 0
    description:
    - Rack to be used in host creation.
    - Required if O(state=present) and host does not yet exist.
    type: int

rank:
    default: 0
    description:
    - Rank to be used in host creation.
    - In Stacki terminology, the rank is the position of the machine in a rack.
    - Required if O(state=present) and host does not yet exist.
    type: int

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Set value to the desired state for the specified host.
    type: str

network:
    default: private
    description:
    - Network to be configured in the host.
    - Currently not used by the module.
    type: str

appliance:
    default: backend
    description:
    - Appliance to be used in host creation.
    - Required if O(state=present) and host does not yet exist.
    type: str

prim_intf:
    description:
    - Name of the primary network interface.
    - Currently not used by the module.
    type: str

stacki_user:
    description:
    - Username for authenticating with Stacki API, but if not specified, the environment
      variable E(stacki_user) is used instead.
    required: true
    type: str

prim_intf_ip:
    description:
    - IP Address for the primary network interface.
    - Currently not used by the module.
    type: str

force_install:
    default: false
    description:
    - Set value to V(true) to force node into install state if it already exists in stacki.
    type: bool

prim_intf_mac:
    description:
    - MAC Address for the primary PXE boot network interface.
    - Currently not used by the module.
    type: str

stacki_endpoint:
    description:
    - URL for the Stacki API Endpoint.
    required: true
    type: str

stacki_password:
    description:
    - Password for authenticating with Stacki API, but if not specified, the environment
      variable E(stacki_password) is used instead.
    required: true
    type: str

Outputs

changed:
  description: response to whether or not the api call completed successfully
  returned: always
  sample: true
  type: bool
stdout:
  description: the set of responses from the commands
  returned: always
  sample:
  - '...'
  - '...'
  type: list
stdout_lines:
  description: the value of stdout split into a list
  returned: always
  sample:
  - - '...'
    - '...'
  - - '...'
  - - '...'
  type: list