pcg.alpaca_operator.alpaca_system module – Manage ALPACA Operator systems 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_system.

New in pcg.alpaca_operator 1.0.0

Synopsis

  • This module allows you to create, update or delete ALPACA Operator systems using the REST API. In addition to general system properties, it supports assigning agents and variables. Communication is handled using token-based authentication.

Requirements

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

  • ALPACA Operator >= 5.6.0

Parameters

Parameter

Comments

agents

list / elements=dictionary

added in pcg.alpaca_operator 1.0.0

A list of agents to assign to the system. Each entry must include: - `name` (string): The agent’s name.

name

string / required

added in pcg.alpaca_operator 1.0.0

Name of the agent.

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.

checks_disabled

boolean

added in pcg.alpaca_operator 2.0.0

Disable automatic system health checks.

Choices:

  • false

  • true

description

string

added in pcg.alpaca_operator 1.0.0

Description of the system.

group_id

integer

added in pcg.alpaca_operator 2.0.0

ID of the group (used if group_name is not provided).

group_name

string

added in pcg.alpaca_operator 2.0.0

Name of the group to which the system should belong.

magic_number

integer

added in pcg.alpaca_operator 2.0.0

Custom numeric field between 0 and 59. Can be used for arbitrary logic in your setup.

Choices:

  • 0

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10

  • 11

  • 12

  • 13

  • 14

  • 15

  • 16

  • 17

  • 18

  • 19

  • 20

  • 21

  • 22

  • 23

  • 24

  • 25

  • 26

  • 27

  • 28

  • 29

  • 30

  • 31

  • 32

  • 33

  • 34

  • 35

  • 36

  • 37

  • 38

  • 39

  • 40

  • 41

  • 42

  • 43

  • 44

  • 45

  • 46

  • 47

  • 48

  • 49

  • 50

  • 51

  • 52

  • 53

  • 54

  • 55

  • 56

  • 57

  • 58

  • 59

name

string / required

added in pcg.alpaca_operator 1.0.0

Unique name (hostname) of the system.

new_name

string

added in pcg.alpaca_operator 1.0.0

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

rfc_connection

dictionary

added in pcg.alpaca_operator 2.0.0

Connection details for accessing the ALPACA Operator API.

client

string

added in pcg.alpaca_operator 1.0.0

Client for RFC connection.

host

string

added in pcg.alpaca_operator 1.0.0

Hostname or IP address of the RFC target system.

instance_number

integer

added in pcg.alpaca_operator 2.0.0

Instance number of the RFC connection.

Choices:

  • 0

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10

  • 11

  • 12

  • 13

  • 14

  • 15

  • 16

  • 17

  • 18

  • 19

  • 20

  • 21

  • 22

  • 23

  • 24

  • 25

  • 26

  • 27

  • 28

  • 29

  • 30

  • 31

  • 32

  • 33

  • 34

  • 35

  • 36

  • 37

  • 38

  • 39

  • 40

  • 41

  • 42

  • 43

  • 44

  • 45

  • 46

  • 47

  • 48

  • 49

  • 50

  • 51

  • 52

  • 53

  • 54

  • 55

  • 56

  • 57

  • 58

  • 59

  • 60

  • 61

  • 62

  • 63

  • 64

  • 65

  • 66

  • 67

  • 68

  • 69

  • 70

  • 71

  • 72

  • 73

  • 74

  • 75

  • 76

  • 77

  • 78

  • 79

  • 80

  • 81

  • 82

  • 83

  • 84

  • 85

  • 86

  • 87

  • 88

  • 89

  • 90

  • 91

  • 92

  • 93

  • 94

  • 95

  • 96

  • 97

  • 98

  • 99

logon_group

string

added in pcg.alpaca_operator 2.0.0

Logon group (used with messageServer type).

password

string

added in pcg.alpaca_operator 1.0.0

Password for the RFC connection. IMPORTANT: If you specify the password in your playbook, the module will ALWAYS report a change (changed=true) on every run, even if nothing has changed. This happens because the API does not return the current password for security reasons, making it impossible to compare the desired password with the current one. The module cannot determine if the password needs to be updated or not. To maintain idempotency, comment out or remove the rfc_connection.password parameter after the initial setup, and only uncomment it when you actually need to change the password.

sap_router_string

string

added in pcg.alpaca_operator 2.0.0

SAProuter string used to establish the RFC connection.

sid

string

added in pcg.alpaca_operator 1.0.0

SAP system ID (SID), consisting of 3 uppercase alphanumeric characters (A-Z, 0-9).

snc_enabled

boolean

added in pcg.alpaca_operator 2.0.0

Enable or disable SNC.

Choices:

  • false

  • true

type

string

added in pcg.alpaca_operator 1.0.0

Type of RFC connection. Can be none, instance, or messageServer.

Choices:

  • "none"

  • "instance"

  • "messageServer"

username

string

added in pcg.alpaca_operator 1.0.0

Username for RFC connection.

state

string

added in pcg.alpaca_operator 1.0.0

Desired state of the system.

Choices:

  • "present" ← (default)

  • "absent"

variables

list / elements=dictionary

added in pcg.alpaca_operator 1.0.0

A list of variables to assign to the system. Each entry must include: - `name` (string): The name of the variable. - `value` (string): The value to assign to the variable.

name

string / required

added in pcg.alpaca_operator 1.0.0

Name of variable.

value

any / required

added in pcg.alpaca_operator 1.0.0

Value of variable.

variables_mode

string

added in pcg.alpaca_operator 1.0.0

Controls how variables are handled when updating the system. update: Add missing variables and update existing ones. replace: Add missing variables, update existing ones, and remove variables not defined in the playbook.

Choices:

  • "update" ← (default)

  • "replace"

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target. Note: If rfc_connection.password is specified, the module will always report changed=true, even in check mode, because the current password cannot be retrieved for comparison.

Examples

- name: Ensure system exists
  pcg.alpaca_operator.alpaca_system:
    name: system01
    description: My Test System
    magic_number: 42
    checks_disabled: false
    group_name: test-group
    rfc_connection:
      type: instance
      host: test-host
      instance_number: 30
      sid: ABC
      logon_group: my-logon-group
      username: rfc_myUser
      password: rfc_myPasswd
      client: 123
      sap_router_string: rfc_SAPRouter
      snc_enabled: false
    agents:
      - name: localhost
      - name: testjan01-agent
    variables:
      - name: "<BKP_DATA_CLEANUP_INT>"
        value: "19"
      - name: "<BKP_DATA_CLEANUP_INT2>"
        value: "this is a string"
      - name: "<BKP_DATA_DEST2>"
        value: "11"
    state: present
    api_connection:
      host: localhost
      port: 8443
      protocol: https
      username: secret
      password: secret
      tls_verify: false

- name: Ensure system is absent
  pcg.alpaca_operator.alpaca_system:
    name: system01
    state: absent
    api_connection:
      host: localhost
      port: 8443
      protocol: https
      username: secret
      password: secret
      tls_verify: false

- name: Rename an existing system
  pcg.alpaca_operator.alpaca_system:
    name: system01
    new_name: system_renamed
    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

Whether any change was made

Returned: always

msg

string

added in pcg.alpaca_operator 1.0.0

Status message

Returned: always

system

dictionary

added in pcg.alpaca_operator 1.0.0

System details

Returned: when state is present

Authors

  • Jan-Karsten Hansmeyer (@pcg)