cisco.ucs.ucs_query module – Queries UCS Manager objects by class or distinguished name
Note
This module is part of the cisco.ucs collection (version 1.8.0).
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 cisco.ucs
.
To use it in a playbook, specify: cisco.ucs.ucs_query
.
New in version 2.8: of cisco.ucs
Parameters
Parameter |
Comments |
---|---|
One or more UCS Manager Class IDs to query. As a comma separated list |
|
Where the module will be run Default: “localhost” |
|
One or more UCS Manager Distinguished Names to query. As a comma separated list |
|
IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator https://cs.co/ucspe |
|
Password for Cisco UCS Manager authentication. |
|
Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
|
If use_proxy is no, specfies proxy to be used for connection. e.g. ‘http://proxy.xy.z:8080’ |
|
If Choices:
|
|
If Choices:
|
|
Username for Cisco UCS Manager authentication. Default: “admin” |
Examples
- name: Query UCS Class ID
cisco.ucs.ucs_query:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
class_ids: computeBlade
delegate_to: localhost
- name: Query UCS Class IDs
cisco.ucs.ucs_query:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
class_ids: computeBlade, fabricVlan
delegate_to: localhost
- name: Query UCS Distinguished Name
cisco.ucs.ucs_query:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
distinguished_names: org-root
delegate_to: localhost
- name: Query UCS Distinguished Names
cisco.ucs.ucs_query:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
distinguished_names: org-root, sys/rack-unit-1, sys/chassis-1/blade-2
delegate_to: localhost
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
results JSON encodded Returned: success |
Authors
John McDonough (@movinalot)
CiscoUcs (@CiscoUcs)