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

client_ca_path

string

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.

client_cert_path

string

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_key_password_b64

aliases: radkit_client_private_key_password_base64

string / required

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.

client_key_path

string

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.

data

dictionary / required

Dictionary containing device information.

description

string

Description of the device.

Default: ""

device_type

string

Type of the device in the RADKit inventory.

Choices:

  • "AIRE_OS"

  • "APIC"

  • "ASA"

  • "BROADWORKS"

  • "CATALYST_CENTER"

  • "CEDGE"

  • "CIMC"

  • "CISCO_AP_OS"

  • "CML"

  • "CMS"

  • "CPS"

  • "CROSSWORK"

  • "CSPC"

  • "CUCM"

  • "CVOS"

  • "CVP"

  • "ESA"

  • "EXPRESSWAY"

  • "FDM"

  • "FMC"

  • "FTD"

  • "GENERIC"

  • "HYPERFLEX"

  • "INTERSIGHT"

  • "IOS_XE"

  • "IOS_XR"

  • "ISE"

  • "LINUX"

  • "NCS_2000"

  • "NEXUS_DASHBOARD"

  • "NSO"

  • "NX_OS"

  • "RADKIT_SERVICE"

  • "ROUTED_PON"

  • "SMA"

  • "SPLUNK"

  • "STAR_OS"

  • "UCCE"

  • "UCS_MANAGER"

  • "ULTRA_CORE_5G_AMF"

  • "ULTRA_CORE_5G_PCF"

  • "ULTRA_CORE_5G_SMF"

  • "WAS"

  • "WLC"

  • "VMANAGE"

enabled

boolean

Boolean to enable or disable the device.

Choices:

  • false

  • true ← (default)

forwarded_tcp_ports

string

TCP ports to be forwarded.

host

string

Hostname or IP address of the device. Required if state is ‘present’ or ‘updated’.

labels

list / elements=string

Labels to be assigned to the device.

Default: []

metadata

list / elements=dictionary

Metadata entries for the device.

key

string / required

Metadata key.

value

string / required

Metadata value.

name

string / required

Name of the device in the RADKit inventory.

terminal

dictionary

Terminal access information.

enable

string

Enable command for terminal access.

enable_set

string

Enable set for terminal access.

password

string / required

Password for terminal access.

port

integer / required

Port for terminal access.

private_key

string

Private key for terminal access.

private_key_password

string

Private key password for terminal access.

username

string / required

Username for terminal access.

identity

aliases: radkit_identity

string / required

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.

radkit_service_name

string / required

Name of the RADKit service to connect to.

service_serial

aliases: radkit_serial, radkit_service_serial

string / required

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.

state

string / required

Desired state of the device. Use ‘present’ to ensure device is present, ‘updated’ to update device, or ‘absent’ to remove device.

Choices:

  • "present"

  • "absent"

  • "updated"

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

device

dictionary

Information about the device operation result.

Returned: success

Authors

  • Scott Dozier (@scdozier)