pcg.alpaca_operator.alpaca_agent module – Manage ALPACA Operator agents 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_agent.
New in pcg.alpaca_operator 1.0.0
Synopsis
This module allows you to create, update or delete ALPACA Operator agents 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 |
|---|---|
Connection details for accessing the ALPACA Operator API. |
|
Hostname of the ALPACA Operator server. Default: |
|
Password for authentication against the ALPACA Operator API. |
|
Port of the ALPACA Operator API. Default: |
|
Protocol to use. Can be Choices:
|
|
Validate SSL certificates. Choices:
|
|
Username for authentication against the ALPACA Operator API. |
|
Unique description of the agent. |
|
Escalation configuration. |
|
Number of failures before reporting. Default: |
|
Mail address for notifications. Default: |
|
Whether mail notification is enabled. Choices:
|
|
SMS address for notifications. Default: |
|
Whether SMS notification is enabled. Choices:
|
|
IP address of the agent. |
|
Location of the agent. Can be Choices:
|
|
Unique name (hostname) of the agent. |
|
Optional new name for the agent. If the agent specified in |
|
Script Group ID. Default: |
|
Desired state of the agent. Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Can run in check_mode and return changed status prediction without modifying target. |
Examples
- name: Ensure agent exists
pcg.alpaca_operator.alpaca_agent:
name: agent01
ip_address: 192.168.1.100
location: virtual
description: Test agent
escalation:
failures_before_report: 3
mail_enabled: true
mail_address: my.mail@pcg.io
sms_enabled: true
sms_address: 0123456789
script_group_id: 0
state: present
api_connection:
host: localhost
port: 8443
protocol: https
username: secret
password: secret
tls_verify: False
- name: Ensure agent is absent
pcg.alpaca_operator.alpaca_agent:
name: agent01
state: absent
api_connection:
host: localhost
port: 8443
protocol: https
username: secret
password: secret
tls_verify: False
- name: Rename an existing agent
pcg.alpaca_operator.alpaca_agent:
name: agent01
new_name: agent_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 |
|---|---|
Details of the created, updated, or deleted agent configuration Returned: when state is present or absent Sample: |
|
Indicates whether any change was made Returned: always Sample: |
|
Dictionary showing differences between the current and desired configuration Returned: when state is present and a change occurred Sample: |
|
Status message indicating the result of the operation Returned: always Sample: |