- 14 Aug 2023
-
DarkLight
-
PDF
Role Execution Parameters
- Updated on 14 Aug 2023
-
DarkLight
-
PDF
Role Execution Parameters
Automation Gateway 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 that are specific to the role itself. A JSON schema that describes 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.
Below is a sample role input parameter for the itential_set_config
role.
Sample Role Request Object
{
"hosts":["eos_host"],
"args":
{
"transactions": [
{
"action": "add",
"parents": ["interface Management 1"],
"config_line": "ip address 10.1.2.3/24",
"id": "anyIDString"
}
]
},
"strict_args": true
}
An Ansible role consists of a number of tasks, each of which produces its own results object.
Automation Gateway collects the task results objects and returns them as an array in the order in which they were executed.