Built-in Ansible roles
Built-in Ansible roles
Itential Automation Gateway (IAG) includes a collection of built-in Ansible roles that perform device monitoring and configuration tasks on supported device types. The roles use advanced features of the command and configuration networking modules developed, tested, and maintained by the Ansible open-source community. Devices are managed by running CLI and NETCONF commands over SSH. Device connectivity parameters are made available through the IAG inventory management subsystem.
Roles in Itential Automation Gateway
The following roles are distributed with Itential Automation Gateway.
Role examples
The following examples show request and response objects for select roles distributed with IAG.
itential_cli
This role also supports handling commands that require a prompt response to complete.
As of 2019.3, this role does not support handling command prompts for F5 (BigIP) devices or Junos devices that are configured with the ansible_connection variable set to netconf.
Request object
Sample:
Response object
Sample:
Request object for command prompts
Sample:
Response object for command prompts
Sample:
itential_get_info
Request object
Sample:
Response object
Sample:
itential_get_health
The itential_get_health response returns a memory usage statistics object and an array of CPU usage objects.
The memory object contains total and free memory values in megabytes. Each object in the cpu_stats array reflects a sample period during which CPU usage was measured. The number of objects in the array is based on what sample periods are available from each device. Note that some network devices track CPU utilization as a percentage, while others use the concept of load average.
The following keys are contained in each CPU usage object.
Request object
Sample:
Response object
Sample:
itential_get_config
The results returned in the config_data field can be passed directly as the value for the config_file parameter of the itential_restore_config role.
Request object
Sample:
Response object
Sample:
itential_set_config
The itential_set_config role takes an array of transactions as an argument. Each transaction is an object representing a single configuration line applied to the device configuration in the order it appears in the array.
Each transaction is treated individually and produces its own status and results. A failure on one transaction doesn’t stop the next transaction from being attempted.
A transaction object consists of the following fields.
Request object
Sample:
Response object
Sample:
itential_restore_config
The itential_restore_config role takes the argument config_file, which is a string buffer containing the device configuration file in its native format. The itential_get_config role returns the device configuration in its native format in the config_data key — those results can serve as a starting point for configuration modifications or be passed as-is to config_file.
SCP requirements for IOS (Cisco) and EOS (Arista) device types
Cisco IOS and Arista EOS devices require the new configuration file to be present on the system before the restore operation can execute. The itential_restore_config role handles this by using the Ansible scp module to transfer the new configuration file to the device. The following SCP and SSH key configuration requirements apply when using itential_restore_config on IOS and EOS devices.
Request object
Sample:
Response object
Sample: