community.general.spectrum_device module – Creates/deletes devices in CA Spectrum

Note

This module is part of the community.general collection (version 8.6.7).

You might already have this collection installed if you are using the ansible package. 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 community.general.

To use it in a playbook, specify: community.general.spectrum_device.

Synopsis

Aliases: monitoring.spectrum_device

Parameters

Parameter

Comments

agentport

integer

UDP port used for SNMP discovery.

Default: 161

community

string / required

SNMP community used for device discovery.

Required when state=present.

device

aliases: host, name

string / required

IP address of the device.

If a hostname is given, it will be resolved to the IP address.

landscape

string / required

Landscape handle of the SpectroServer to which add or remove the device.

state

string

On present creates the device when it does not exist.

On absent removes the device when it exists.

Choices:

  • "present" ← (default)

  • "absent"

url

aliases: oneclick_url

string / required

HTTP, HTTPS URL of the Oneclick server in the form (http|https)://host.domain[:port].

url_password

aliases: oneclick_password

string / required

Oneclick user password.

url_username

aliases: oneclick_user

string / required

Oneclick user name.

use_proxy

boolean

if false, it will not use a proxy, even if one is defined in an environment variable on the target hosts.

Choices:

  • false

  • true ← (default)

validate_certs

boolean

If false, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

Choices:

  • false

  • true ← (default)

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Notes

Note

  • The devices will be created inside the Universe container of the specified landscape.

  • All the operations will be performed only on the specified landscape.

Examples

- 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


- 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

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

device

dictionary

device data when state = present

Returned: success

Sample: {"address": "10.10.5.1", "landscape": "0x100000", "model_handle": "0x1007ab"}

Authors

  • Renato Orgito (@orgito)