pcg.alpaca_operator.alpaca_group module – Manage ALPACA Operator groups via REST API

Note

This module is part of the pcg.alpaca_operator collection (version 2.2.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 pcg.alpaca_operator. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: pcg.alpaca_operator.alpaca_group.

New in pcg.alpaca_operator 1.0.0

Synopsis

  • This module allows you to create, rename or delete ALPACA Operator groups using the REST API.

Requirements

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

  • ALPACA Operator >= 5.6.0

Parameters

Parameter

Comments

api_connection

dictionary / required

added in pcg.alpaca_operator 2.0.0

Connection details for accessing the ALPACA Operator API.

host

string

added in pcg.alpaca_operator 1.0.0

Hostname of the ALPACA Operator server.

Default: "localhost"

password

string / required

added in pcg.alpaca_operator 1.0.0

Password for authentication against the ALPACA Operator API.

port

integer

added in pcg.alpaca_operator 1.0.0

Port of the ALPACA Operator API.

Default: 8443

protocol

string

added in pcg.alpaca_operator 1.0.0

Protocol to use. Can be http or https.

Choices:

  • "http"

  • "https" ← (default)

tls_verify

boolean

added in pcg.alpaca_operator 1.0.0

Validate SSL certificates.

Choices:

  • false

  • true ← (default)

username

string / required

added in pcg.alpaca_operator 1.0.0

Username for authentication against the ALPACA Operator API.

name

string / required

added in pcg.alpaca_operator 1.0.0

Name of the group.

new_name

string

added in pcg.alpaca_operator 1.0.0

Optional new name for the group. If the group specified in name exists, it will be renamed to this value. If the group does not exist, a new group will be created using this value.

state

string

added in pcg.alpaca_operator 1.0.0

Desired state of the group.

Choices:

  • "present" ← (default)

  • "absent"

Attributes

Attribute

Support

Description

check_mode

Support: full

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

Examples

- name: Ensure group exists
  pcg.alpaca_operator.alpaca_group:
    name: testgroup01
    state: present
    api_connection:
      host: localhost
      port: 8443
      protocol: https
      username: secret
      password: secret
      tls_verify: false

- name: Ensure group is absent
  pcg.alpaca_operator.alpaca_group:
    name: testgroup01
    state: absent
    api_connection:
      host: localhost
      port: 8443
      protocol: https
      username: secret
      password: secret
      tls_verify: false

- name: Rename an existing group
  pcg.alpaca_operator.alpaca_group:
    name: testgroup01
    new_name: testgroup_renamed
    state: present
    api_connection:
      host: localhost
      port: 8443
      protocol: https
      username: secret
      password: secret
      tls_verify: false

Return Values

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

Key

Description

changed

boolean

added in pcg.alpaca_operator 1.0.0

Indicates whether any change was made to the group

Returned: always

Sample: true

id

integer

added in pcg.alpaca_operator 1.0.0

Numeric ID of the group (if known or newly created)

Returned: when state is present or absent and group exists

Sample: 42

msg

string

added in pcg.alpaca_operator 1.0.0

Human-readable message describing the outcome

Returned: always

Sample: "Group created"

name

string

added in pcg.alpaca_operator 1.0.0

Name of the group (new or existing)

Returned: always

Sample: "testgroup01"

Authors

  • Jan-Karsten Hansmeyer (@pcg)