Task Key Naming Convention
  • Dark
    Light
  • PDF

Task Key Naming Convention

  • Dark
    Light
  • PDF

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:

{role} response

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.

Note that the format of the data contained within the results object will vary per role.

In addition, a status key 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.

Sample Role Response

[
    {
        "role": "itential_set_config",
        "task": "execute config module on eos platform",
        "host": "eos_host",
        "status": "SUCCESS",
        "argument_warnings": null,
        "results": {
            "commands": [
                "interface Management 1",
                "ip address 10.0.5.17/24"
            ],
            "changed": true,
            "session": "ansible_1548718829",
            "updates": [
                "interface Management 1",
                "ip address 10.0.5.17/24"
            ],
            "diff": {
                "prepared": "--- system:/running-config\n+++ session:/ansible_1548718829-session-config\n@@ -27,6 +27,7 @@\n
    ip address 192.168.32.20/24\n !\n interface Management1\n+   ip address 10.0.5.17/24\n !\n ip route 0.0.0.0/0 10.0.2.2\n !"
            }
        }
    },
    {
        "role": "itential_set_config",
        "task": "itential_set_config response",
        "host": "eos_host",
        "status": "SUCCESS",
        "argument_warnings": null,
        "results": {
            "config_request": {
                "action": "add",
                "config_line": "ip address 10.0.5.17/24",
                "parents": [
                    "interface Management 1"
                ],
                "id": "anyIDString"
            },
            "config_response": {
                "failed": false,
                "changed": true,
                "id": "anyIDString"
            },
            "changed": false
        }
    }
]

What's Next