Role execution parameters
Itential Automation Gateway (IAG) clients execute roles on a device using the REST /roles/{role_name}/execute route. The role execution input parameter is a JSON object that contains an array of host strings and an args object that includes a set of key/value pairs specific to the role. A JSON schema describing each role’s argument parameters is available via the /roles/{role_name} route. Detailed documentation on role endpoints can be found in the API Documentation section of the Automation Gateway UI.
Role request object
Below is a sample role input parameter for the itential_set_config role:
An Ansible role consists of a number of tasks, each of which produces its own results object, as discussed in the section that follows.
IAG collects the task results objects and returns them as an array in the order in which they were executed.
For information on execution flow in the release versions of IAG, see Execution flow by role type.
Task results object and key
The Itential Ansible roles include a task results object with a task key whose value always takes the form of the task key naming convention shown below:
Where {role} is replaced with the name of the role executed.
Example: itential_set_config response
The results object from that response task contains the response data from the role for the device.
All other task results can be ignored and are available for informational and debugging purposes only.
The format of the data contained within the results object varies per role.
A status key also indicates whether the task succeeded (SUCCESS) or failed (FAILURE).
Roles that contain multiple requests will have multiple response objects, each with their own status and results keys.
Role response
Below is the sample role response for the itential_set_config role: