cisco.intersight.intersight_info – Gather information about Intersight
Note
This plugin is part of the cisco.intersight collection (version 1.0.18).
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.intersight
.
To use it in a playbook, specify: cisco.intersight.intersight_info
.
New in version 2.8: of cisco.intersight
Synopsis
Gathers information about servers in Cisco Intersight.
This module was called
intersight_facts
before Ansible 2.9. The usage did not change.
Parameters
Parameter |
Comments |
---|---|
Public API Key ID associated with the private key. If not set, the value of the INTERSIGHT_API_KEY_ID environment variable is used. |
|
Filename (absolute path) or string of PEM formatted private key data to be used for Intersight API authentication. If a string is used, Ansible vault should be used to encrypt string data. Ex. ansible-vault encrypt_string –vault-id tme@/Users/dsoper/Documents/vault_password_file ‘—–BEGIN EC PRIVATE KEY—–
If not set, the value of the INTERSIGHT_API_PRIVATE_KEY environment variable is used. |
|
URI used to access the Intersight API. If not set, the value of the INTERSIGHT_API_URI environment variable is used. Default: “https://intersight.com/api/v1” |
|
Server names to retrieve information from. An empty list will return all servers. |
|
If Choices:
|
|
Boolean control for verifying the api_uri TLS certificate Choices:
|
Examples
- name: Get info for all servers
intersight_info:
api_private_key: ~/Downloads/SecretKey.txt
api_key_id: 64612d300d0982/64612d300d0b00/64612d300d3650
server_names:
- debug:
msg: "server name {{ item.Name }}, moid {{ item.Moid }}"
loop: "{{ intersight_servers }}"
when: intersight_servers is defined
- name: Get info for servers by name
intersight_info:
api_private_key: ~/Downloads/SecretKey.txt
api_key_id: 64612d300d0982/64612d300d0b00/64612d300d3650
server_names:
- SJC18-L14-UCS1-1
- debug:
msg: "server moid {{ intersight_servers[0].Moid }}"
when: intersight_servers[0] is defined
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A list of Intersight Servers. See Cisco Intersight for details. Returned: always |
|
The unique identifier of this Managed Object instance. Returned: always Sample: “5978bea36ad4b000018d63dc” |
|
The name of the server. Returned: always Sample: “SJC18-L14-UCS1-1” |
Authors
David Soper (@dsoper2)
CiscoUcs (@CiscoUcs)