community.general.spectrum_model_attrs module – Enforce a model’s attributes in CA Spectrum.
Note
This module is part of the community.general collection (version 4.8.3).
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_model_attrs
.
New in version 2.5.0: of community.general
Requirements
The below requirements are needed on the host that executes this module.
python >= 2.7
Parameters
Parameter |
Comments |
---|---|
A list of attribute names and values to enforce. All values and parameters are case sensitive and must be provided as strings only. |
|
Attribute name OR hex ID. Currently defined names are:
Hex IDs are the direct identifiers in Spectrum and will always work. To lookup hex IDs go to the UI: Locator -> Devices -> By Model Name -> <enter any model> -> Attributes tab. |
|
Attribute value. Empty strings should be |
|
Model name. |
|
Model type. |
|
URL of OneClick server. |
|
OneClick password. |
|
OneClick username. |
|
if Choices:
|
|
Validate SSL certificates. Only change this to Choices:
|
Notes
Note
Tested on CA Spectrum version 10.4.2.0.189.
Model creation and deletion are not possible with this module. For that use community.general.spectrum_device instead.
Examples
- name: Enforce maintenance mode for modelxyz01 with a note about why
community.general.spectrum_model_attrs:
url: "http://oneclick.url.com"
username: "{{ oneclick_username }}"
password: "{{ oneclick_password }}"
name: "modelxyz01"
type: "Host_Device"
validate_certs: true
attributes:
- name: "isManaged"
value: "false"
- name: "Notes"
value: "MM set on {{ ansible_date_time.iso8601 }} via CO {{ CO }} by {{ tower_user_name | default(ansible_user_id) }}"
delegate_to: localhost
register: spectrum_model_attrs_status
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Dictionary of changed name or hex IDs (whichever was specified) to their new corresponding values. Returned: always Sample: {“Notes”: “MM set on 2021-02-03T22:04:02Z via CO CO9999 by tgates”, “isManaged”: “true”} |
|
Informational message on the job result. Returned: always Sample: “Success” |
Authors
Tyler Gates (@tgates81)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication