community.general.spectrum_device (8.5.0) — module

Creates/deletes devices in CA Spectrum

Authors: Renato Orgito (@orgito)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

This module allows you to create and delete devices in CA Spectrum U(https://www.ca.com/us/products/ca-spectrum.html).

Tested on CA Spectrum 9.4.2, 10.1.1 and 10.2.1

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add device to CA Spectrum
  local_action:
    module: spectrum_device
    device: '{{ ansible_host }}'
    community: secret
    landscape: '0x100000'
    oneclick_url: http://oneclick.example.com:8080
    oneclick_user: username
    oneclick_password: password
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: Remove device from CA Spectrum
  local_action:
    module: spectrum_device
    device: '{{ ansible_host }}'
    landscape: '{{ landscape_handle }}'
    oneclick_url: http://oneclick.example.com:8080
    oneclick_user: username
    oneclick_password: password
    use_proxy: false
    state: absent

Inputs

    
url:
    aliases:
    - oneclick_url
    description:
    - HTTP, HTTPS URL of the Oneclick server in the form V((http|https\)://host.domain[:port]).
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - On V(present) creates the device when it does not exist.
    - On V(absent) removes the device when it exists.
    type: str

device:
    aliases:
    - host
    - name
    description:
    - IP address of the device.
    - If a hostname is given, it will be resolved to the IP address.
    required: true
    type: str

agentport:
    default: 161
    description:
    - UDP port used for SNMP discovery.
    required: false
    type: int

community:
    description:
    - SNMP community used for device discovery.
    - Required when O(state=present).
    required: true
    type: str

landscape:
    description:
    - Landscape handle of the SpectroServer to which add or remove the device.
    required: true
    type: str

use_proxy:
    default: true
    description:
    - if V(false), it will not use a proxy, even if one is defined in an environment variable
      on the target hosts.
    type: bool

url_password:
    aliases:
    - oneclick_password
    description:
    - Oneclick user password.
    required: true
    type: str

url_username:
    aliases:
    - oneclick_user
    description:
    - Oneclick user name.
    required: true
    type: str

validate_certs:
    default: true
    description:
    - If V(false), SSL certificates will not be validated. This should only be used on
      personally controlled sites using self-signed certificates.
    type: bool

Outputs

device:
  description: device data when state = present
  returned: success
  sample:
    address: 10.10.5.1
    landscape: '0x100000'
    model_handle: '0x1007ab'
  type: dict