automatics_ai.automatics.generic_workflow (2.1.2) — module

Execute any workflow in automatics

Authors: automatics.AI Development (@automatics-ai) <dev@automatics.ai>

Install collection

Install with ansible-galaxy collection install automatics_ai.automatics:==2.1.2


Add to requirements.yml

  collections:
    - name: automatics_ai.automatics
      version: 2.1.2

Description

Execute any workflow in automatics

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run workflow "Set specific profile parameters" with Workflow-Name and System-Name selection
  automatics_ai.automatics.system:
    hostname: automatics.example.org
    auth_token: aW4iLCJlbWFpbCI6ImFkbWluIiw...
    validate_certs: false
    workflow: Set specific profile parameters
    systems:
      - 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run workflow "SAP Notes Implementation" with Workflow-ID and System-ID selection
  automatics_ai.automatics.system:
    hostname: automatics.example.org
    auth_token: aW4iLCJlbWFpbCI6ImFkbWluIiw...
    validate_certs: false
    workflow_id: 054faffd-a6a2-412e-84e2-049ea5cc1cb5
    system_ids:
      - 1537
      - 1538
    parameters:
      Comment: Triggered by Ansible
      ImplementNotes: "3268172,3294954"
      NotRelevantNotes: "2676414,2997449"
      TransportDescription: "automatics SAPNotes implementation by Ansible"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run workflow "SAP Component Restart" with Workflow-Name and Component-Name selection
  automatics_ai.automatics.system:
    hostname: automatics.example.org
    auth_token: aW4iLCJlbWFpbCI6ImFkbWluIiw...
    validate_certs: false
    workflow: SAP Component Restart
    components:
      - type: sap-as-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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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)
    systems:
      - 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

Inputs

    
nodes:
    description:
    - nodes in automatics to select for the operation (name/hostname matching)
    - dict containing 'name' and 'client' that must match the automatics name and client
    elements: dict
    required: false
    suboptions:
      client:
        default: '1'
        description:
        - the client to which the system is assigned
        - can either be the client id or client name
        - default is client with id=1, what is the automatics default client
        required: false
        type: str
      name:
        description:
        - must either match the node-name or node-hostname in automatics
        required: true
        type: str
    type: list

systems:
    description:
    - 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>
    elements: dict
    required: false
    suboptions:
      client:
        default: '1'
        description:
        - the client to which the system is assigned
        - can either be the client id or client name
        - default is client with id=1, what is the automatics default client
        required: false
        type: str
      name:
        description:
        - must match the automatics system name
        required: true
        type: str
      type:
        choices:
        - sap
        - sap-hana-db
        - sap-wdp
        description:
        - must match the automatics system-type
        required: true
        type: str
    type: list

hostname:
    description:
    - Hostname of the automatics server.
    required: true
    type: str

node_ids:
    description:
    - nodes in automatics to select for the operation (id matching)
    - must match the automatics node-id
    elements: int
    required: false
    type: list

workflow:
    description:
    - workflow in automatics to select for the operation (name matching)
    required: false
    type: str

auth_token:
    description:
    - automatics authentication bearer token returned from automatics_login module
    required: true
    type: str

components:
    description:
    - components in automatics to select for the operation (name matching)
    - dict with 'type', 'name, 'instance_number' and 'client' that must match the automatics
      component-type, name, instance-id and client
    elements: dict
    required: false
    suboptions:
      client:
        default: '1'
        description:
        - the client to which the component is assigned
        - can either be the client id or client name
        - default is client with id=1, what is the automatics default client
        required: false
        type: str
      instance_number:
        description:
        - must match the automatics component instance-id
        required: false
        type: str
      name:
        description:
        - must match the automatics component name
        required: true
        type: str
      type:
        choices:
        - sap-ascs
        - sap-scs
        - sap-ers
        - sap-as-abap
        - sap-as-java
        - sap-wdp
        - sap-hana-db
        - sap-hana-tenant
        - sap-db2
        - sap-mssql
        - sap-oracle
        - sap-ase
        - sap-maxdb
        description:
        - must match the automatics component-type
        required: true
        type: str
    type: list

parameters:
    description:
    - 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.
    required: false
    type: raw

system_ids:
    description:
    - systems in automatics to select for the operation (id matching)
    - must match the automatics system-id
    elements: int
    required: false
    type: list

workflow_id:
    description:
    - workflow in automatics to select for the operation (id matching)
    required: false
    type: str

component_ids:
    description:
    - components in automatics to select for the operation (id matching)
    - must match the automatics component-id
    elements: int
    required: false
    type: list

validate_certs:
    default: true
    description:
    - Verify the https certificate of the automatics server.
    required: false
    type: bool

execution_timeout:
    default: 120
    description:
    - Execution timeout in minutes for the triggered executions in automatics
    required: false
    type: int

Outputs

info:
  description: Information on all triggered automatics executions
  elements: dict
  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
  type: list