cisco.radkit.controlapi_device module – Manage devices in RADKit inventory via Control API
Note
This module is part of the cisco.radkit collection (version 2.0.0).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install git+https://wwwin-github.cisco.com/scdozier/cisco.radkit-ansible.git
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: cisco.radkit.controlapi_device
.
New in cisco.radkit 1.8.0
Synopsis
Adds, updates, or removes devices in the RADKit inventory using RADKit’s Control API
Provides comprehensive device configuration management with validation
Supports credential management and device state enforcement
Includes detailed error reporting and status tracking
Requirements
The below requirements are needed on the host that executes this module.
radkit
Parameters
Parameter |
Comments |
---|---|
Alternate path to client ca cert for RADKIT If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_CLIENT_CA_PATH will be used instead. |
|
Alternate path to client cert for RADKIT If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_CLIENT_CERT_PATH will be used instead. |
|
Client certificate password in base64 If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_CLIENT_PRIVATE_KEY_PASSWORD_BASE64 will be used instead. |
|
Alternate path to client key for RADKIT If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_CLIENT_KEY_PATH will be used instead. |
|
Dictionary containing device information. |
|
Description of the device. Default: |
|
Type of the device in the RADKit inventory. Choices:
|
|
Boolean to enable or disable the device. Choices:
|
|
TCP ports to be forwarded. |
|
Hostname or IP address of the device. Required if state is ‘present’ or ‘updated’. |
|
Labels to be assigned to the device. Default: |
|
Metadata entries for the device. |
|
Metadata key. |
|
Metadata value. |
|
Name of the device in the RADKit inventory. |
|
Terminal access information. |
|
Enable command for terminal access. |
|
Enable set for terminal access. |
|
Password for terminal access. |
|
Port for terminal access. |
|
Private key for terminal access. |
|
Private key password for terminal access. |
|
Username for terminal access. |
|
Identity to authentiate with RADKit (xxxx@cisco.com). If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_IDENTITY will be used instead. |
|
Name of the RADKit service to connect to. |
|
Radkit service serial If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_SERVICE_SERIAL will be used instead. |
|
Desired state of the device. Use ‘present’ to ensure device is present, ‘updated’ to update device, or ‘absent’ to remove device. Choices:
|
Examples
- name: Add a device to RADKit inventory
cisco.radkit.controlapi_device:
radkit_service_name: radkit
data:
name: Test12345
host: 12345
device_type: IOS_XE
enabled: True
description: my test device
forwarded_tcp_ports: '22'
metadata:
- key: location
value: datacenter-1
- key: owner
value: network-team
- key: environment
value: production
terminal:
port: 22
username: test
password: mypassword
private_key_password: my_private_key_password
private_key: my_private_key
enable_set: my_enable_set
enable: my_enable_command
state: present
register: device_output
delegate_to: localhost
- name: Remove device from RADKit inventory with only name
cisco.radkit.controlapi_device:
radkit_service_name: radkit
data:
name: test123
state: absent
delegate_to: localhost
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Information about the device operation result. Returned: success |