automatics.automatics.automatics_generic_workflow module – Execute any workflow in automatics

Note

This module is part of the automatics.automatics collection (version version_filler).

To install it, use: ansible-galaxy collection install automatics.automatics.

To use it in a playbook, specify: automatics.automatics.automatics_generic_workflow.

Synopsis

  • Execute any workflow in automatics

Parameters

Parameter

Comments

auth_token

string / required

automatics authentication bearer token returned from automatics_login module

component

list / elements=dictionary

components in automatics to select for the operation (name matching)

dict containing ‘type’, ‘name, ‘instance_number’ and ‘client’ that must match the automatics component-type, name, instance-id and client

client

string

the client to which the component is assigned

can either be the client id or client name

Default: "default client (id=1)"

instance_number

string

must match the automatics component instance-id

name

string / required

must match the automatics component name

type

string / required

must match the automatics component-type

Choices:

  • "sap-ascs"

  • "sap-scs"

  • "sap-ers"

  • "sap-aas-abap"

  • "sap-aas-java"

  • "sap-wdp"

  • "sap-hana-db"

  • "sap-hana-tenant"

  • "sap-db2"

  • "sap-mssql"

  • "sap-oracle"

  • "sap-ase"

  • "sap-maxdb"

component_id

list / elements=integer

components in automatics to select for the operation (id matching)

must match the automatics component-id

execution_timeout

integer

Execution timeout in minutes for the triggered executions in automatics

hostname

string / required

Hostname of the automatics server.

node

list / elements=dictionary

nodes in automatics to select for the operation (name/hostname matching)

dict containing ‘name’ and ‘client’ that must match the automatics name and client

client

string

the client to which the system is assigned

can either be the client id or client name

Default: "default client (id=1)"

name

string / required

must either match the node-name or node-hostname in automatics

node_id

list / elements=integer

nodes in automatics to select for the operation (id matching)

must match the automatics node-id

parameters

any

automatics parameters for executiong a workflow

the following parameters should not be used here: ‘ClientID’, ‘SystemID’, ‘ComponentID’, ‘NodeID’. These are automatically generated based on the system(_id), component(_id) or node(_id) selection.

system

list / elements=dictionary

systems in automatics to select for the operation (name matching)

dict containing ‘type’, ‘name’ and ‘client’ that must match the automatics system-type, name and client

for systems of type ‘sap’ and ‘sap-hana-db’, the ‘name’ equals the SAP SID

for systems of type ‘sap-wdp’, the ‘name’ equals <sapsid>@<node>

client

string

the client to which the system is assigned

can either be the client id or client name

Default: "default client (id=1)"

name

string / required

must match the automatics system name

type

string / required

must match the automatics system-type

Choices:

  • "sap"

  • "sap-hana-db"

  • "sap-wdp"

system_id

list / elements=integer

systems in automatics to select for the operation (id matching)

must match the automatics system-id

validate_certs

boolean

Verify the https certificate of the automatics server.

Choices:

  • false

  • true ← (default)

workflow

string

workflow in automatics to select for the operation (name matching)

workflow_id

string

workflow in automatics to select for the operation (id matching)

Notes

Note

  • either ‘system’ or ‘system_id’ is required for workflows with ‘wizard_selection_type’ = ‘systems’

  • either ‘system’ or ‘system_id’ is required for workflows with ‘wizard_selection_type’ = ‘sap_profiles’

  • either ‘system’ or ‘system_id’ is required for workflows with ‘wizard_selection_type’ = ‘sap_notes’

  • either ‘component’ or ‘component_id’ is required for workflows with ‘wizard_selection_type’ = ‘components’

  • either ‘node’ or ‘node_id’ is required for workflows with ‘wizard_selection_type’ = ‘nodes’

Examples

- name: Run workflow "Set specific profile parameters" with Workflow-Name and System-Name selection
  automatics.automatics.automatics_system:
    hostname: automatics.example.org
    auth_token: aW4iLCJlbWFpbCI6ImFkbWluIiw...
    validate_certs: false
    workflow: Set specific profile parameters
    system:
      - type: sap
        name: AUT
      - type: sap
        name: AUS
    parameters:
      Comment: Triggered by Ansible
      IgnorePFPARErrors: true
      IgnorePriorities: true
      RestartSystem: false
      ParameterList:
      - profile_name: DEFAULT
        parameter_name: rdisp/max_wprun_time
        old_value: ""
        new_value: "3600"
      - profile_name: DEFAULT
        parameter_name: login/min_password_lng
        old_value: ""
        new_value: "16"

- name: Run workflow "SAP Notes Implementation" with Workflow-ID and System-ID selection
  automatics.automatics.automatics_system:
    hostname: automatics.example.org
    auth_token: aW4iLCJlbWFpbCI6ImFkbWluIiw...
    validate_certs: false
    workflow_id: 054faffd-a6a2-412e-84e2-049ea5cc1cb5
    system_id:
      - 1537
      - 1538
    parameters:
      Comment: Triggered by Ansible
      ImplementNotes: "3268172,3294954"
      NotRelevantNotes: "2676414,2997449"
      TransportDescription: "automatics SAPNotes implementation by Ansible"

- name: Run workflow "SAP Component Restart" with Workflow-Name and Component-Name selection
  automatics.automatics.automatics_system:
    hostname: automatics.example.org
    auth_token: aW4iLCJlbWFpbCI6ImFkbWluIiw...
    validate_certs: false
    workflow: SAP Component Restart
    component:
      - type: sap-aas-abap
        name: AUT-AS
        instance_number: "02"
        client: automatics
      - type: sap-ascs
        name: RD1-ASCS
      - type: sap-db2
        name: NDB-DB
        client: Customer2
    parameters:
      Comment: Triggered by Ansible
      UserMessage: "SAP will be restarted in 30 min. Please finish your work and close the app."
      ExecutionDelay: 30

- name: Run workflow "SAP Diagnostic Agent Change (Fileshare)" with Workflow-Name and Node-Name selection
  automatics_generic_workflow:
    auth_token: "{{ auth.token }}"
    hostname: 10.99.0.99
    validate_certs: false
    workflow: SAP Diagnostic Agent Change (Fileshare)
    system:
      - name: aut-aut-app1.automatics.at
        client: automatics
      - name: aut-aus-app2
        client: Customer1
    parameters:
      Comment: Triggered by Ansible
      KernelMountLinux: "/mnt/sapinst/DAA/patch/lnx/"
      AllowKernelDowngrade: false
      RestartSystem: true
      CompressKernelBackup: true
      AutomaticRollback: true

Return Values

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

Key

Description

info

list / elements=dictionary

Information on all triggered automatics executions

Returned: always

Sample: [{"comment": null, "date_ended": 1676039330, "date_started": 1676039108, "parameters": {"ClientID": {"default": false, "label": "Client ID", "origin": "automatics", "type": "client", "value": "1"}, "ExecutionDelay": {"default": true, "label": "Execution Delay", "origin": "automatics", "type": "timespan", "value": "0"}, "SystemID": {"default": false, "details": {"name": "RD1"}, "label": "System ID", "origin": "automatics", "type": "system", "value": "1035"}, "WorkflowTimeout": {"default": true, "label": "Workflow Timeout", "origin": "automatics", "type": "timespan", "value": "21600"}}, "runtime": 221.4, "status": "succeeded", "user": "ansible", "workflow": {"description": "Start one or more SAP systems including all components", "id": "251af40c-c3f9-4749-a23c-fb79ffd3a5de", "name": "SAP System Start", "origin": "automatics"}}]

Authors

  • Manuel Sanz