Ansible modules for Ops Center Automator

Ops Center Automator User Guide

Version
10.8.x
File Size
3.6 MB
Audience
anonymous
Part Number
MK-99AUT001-14

Two modules in the Ansible playbook are needed to use Ops Center Automator.

Submit Automator Service
automation_submit_service
Invoke the Automator service from the Ansible playbook
Get Automator Task
automation_task_detail_info
Get details of the task result of the submitted Automator service
Note:
  • If Common Services is linked with an identity provider, the identity provider user cannot access Ops Center Automator from the Ansible playbook.
  • When the Ansible playbook is run with the --check option, it will not make any changes. Instead it will preverify the parameters and report whether a new task will be created. The automation_submit_service module supports check mode (--check option), but the automation_task_info module does not.
  • By default, the Automator Ansible modules use the http_proxy or no_proxy environment variables on the managed node. If there was an error caused by using an unintended proxy, you can specify no_proxy to avoid using a proxy.
  • Only UTF-8 has been verified as the encoding type of the Ansible playbook.

For more information on how to use the Ansible playbook, see the Ansible documentation.

The parameters of the Automator modules for the Ansible playbook are shown in the following tables.

Table. Input parameters for automation_submit_service module
Name Type Description Range Default value
host* string The hostname or IP address of the Automator server. - -
port integer The TCP port number of the Automator server to access the REST API endpoint. - 22015 or 22016
ssl boolean Specify whether to enable SSL communication for connecting to the server. SSL communication for connecting to the Common Services server is enabled regardless of the setting of this parameter. yes or no yes
validate_certs boolean Specify whether to enable validation for server SSL certificate. This parameter is ignored if the ssl parameter is set to no. yes or no yes
user* string The user name to access the Automator server. - -
password* string The password to access the Automator server.

The no_log option is enabled by default to ensure that password data is not recorded in the log.

- -
service_name* string The name of target service to run, which is configured within the Automator server. - -
service_group string The name of the service group to which the target service belongs. If this option is not specified, the service group that is associated with the user is applied. - -
service_parameters dictionary

Dictionary parameter that contains a "keyName" and "value" pair to be passed when running the service. The specified parameters are prioritized over the default parameters specified in the service. The key-value pairs to pass as input required to run the service. Format each key and value as a string type.

This parameter only supports the "true" or "false" boolean notation.

Use the no_ log option to ensure that sensitive data is not recorded in the log.

- empty dictionary
task_name string The name of the task. If this option is not specified, a default unique name is assigned. If a task with the same task_name exists and has already finished, this module returns the information from the finished task, and skips to submit a new task. - -
task_description string The task description. - -
task_wait boolean Specify yes for the module to wait for the task to finish before sending a result.

Specify no for the module to send a result immediately after the service request is accepted by the Automator server.

yes or no yes
task_timeout integer The timeout value for the wait completion of the task (in seconds). If no is specified for the task_wait parameter, this parameter is ignored.

If you specify a value greater than 31536000 (1 year), the Automator module internally assign 31536000 to task_timeout.

5 - 31536000 3600
wait_interval integer The interval (in seconds) for verifying the Automator server for task completion. If no is specified for the task_wait parameter, this parameter is ignored. 5 - 300 30
cs_host string The host name or IP address of Common Services where the Ops Center Automator specified for the "host" parameter is registered. If you specify this parameter, you must set up SSL communication between the Ops Center Automator server and the Common Services server. If this is not specified, Common Component user authentication is used to access Ops Center Automator. - -
cs_port integer The port number of Common Services where the Ops Center Automator specified for the "host" parameter is registered. If this is not specified, the default value of 443 is set. - 443
*: Required
Table. Output parameters
Parameter Type Comments
outputs json The task output properties.

The json object contains the following elements:

properties
Key-value pairs of input and output parameters.
task
The Automator task object.
id
Instance ID of the Automator task object.

The following is an example output parameter structure:

{
   "outputs": {
     "id": 600943,
     "properties": {
       "propertyKey1": "10",
       "propertyKey2": "20"
   },
   "task": {
     "instanceID" : 600943,
     "name" : "add_number_service_20200115144709",
     "status" : "completed",
     "startTime" : "2020-01-15T14:47:12.000+09:00",
     "completionTime" : "2020-01-15T14:47:12.000+09:00",
     "submitter" : "System",
     "submitTime" : "2020-01-15T14:47:12.000+09:00",
     "modifyTime" : "2020-01-15T14:47:12.000+09:00",
     "serviceState" : "release",
     "scheduleType" : "immediate",
     "description" : "",
     "serviceName" : "add_number_service",
     "tags" : "",
     "serviceGroupName" : "Default Service Group",
     "toDo" : false,
     "notes" : "",
     "supportedActionType" : "forciblyStop,retry",
     "serviceTemplateID" : 596812,
     "scheduleID" : 600962,
     "serviceGroupID" : 595910,
     "serviceID" : 600882
    } 
  }
}
Table. Input parameters for automation_task_detail_info module
Name Type Description Range Default value
host* string The hostname or IP address of the Automator server. - -
port integer The TCP port number of the Automator server to access the REST API endpoint. - 22015 or 22016
ssl boolean Specify whether to enable SSL communication for connecting to the server. SSL communication for connecting to the Common Services server is enabled regardless of the setting of this parameter. yes or no yes
validate_certs boolean Specify whether to enable validation for server SSL certificate. This parameter is ignored if the ssl parameter is set to no. yes or no yes
user* string The user name to access the Automator server. - -
password* string The password to access the Automator server.

The no_log option is enabled by default to ensure that password data is not recorded in the log.

- -
task_id* integer The task id of the Ops Center Automator service to be invoked by Ansible module. - -
task_wait boolean Specify yes for the module to wait for the task to finish before sending a result.

Specify no for the module to send a result immediately after the service request is accepted by the Automator server.

yes or no yes
task_timeout integer The timeout value for the wait completion of the task (in seconds). If no is specified for the task_wait parameter, this parameter is ignored.

If you specify a value greater than 31536000 (1 year), the Automator module internally assign 31536000 to task_timeout.

5 - 31536000 3600
wait_interval integer The interval (in seconds) for verifying the Automator server for task completion. If no is specified for the task_wait parameter, this parameter is ignored. 5 - 300 30
cs_host string The host name or IP address of Common Services where the Ops Center Automator specified for the "host" parameter is registered. If you specify this parameter, you must set up SSL communication between the Ops Center Automator server and the Common Services server. If this is not specified, Common Component user authentication is used to access Ops Center Automator. - -
cs_port integer The port number of Common Services where the Ops Center Automator specified for the "host" parameter is registered. If this is not specified, the default value of 443 is set. - 443
*: Required
Table. Output parameters
Parameter Type Comments
outputs json The task output properties.

The json object contains the following elements:

properties
Key-value pairs of input and output parameters.
task
The Automator task object.
id
Instance ID of the Automator task object.

About logging

By default Ansible sends output about plays, tasks, and module arguments to your screen (STDOUT) on the control node. To capture Ansible output in a log, see the Ansible documentation.

If you deal any sensitive data while running the Ansible playbook, such as passwords or user names, you should use the no_log option on the task. If the playbook fails and no details are output, then you should disable the no_log option and re-run the playbook.

For more information about the no_log option, see the Ansible documentation.