cisco.intersight.intersight_facts (1.0.6) — module

Gather facts about Intersight

| "added in version" 2.8 of cisco.intersight"

Authors: David Soper (@dsoper2), CiscoUcs (@CiscoUcs)

preview | supported by community

Install collection

Install with ansible-galaxy collection install cisco.intersight:==1.0.6


Add to requirements.yml

  collections:
    - name: cisco.intersight
      version: 1.0.6

Description

Gathers facts about servers in L(Cisco Intersight,https://intersight.com).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get facts for all servers
  intersight_facts:
    api_private_key: ~/Downloads/SecretKey.txt
    api_key_id: 64612d300d0982/64612d300d0b00/64612d300d3650
    server_names:
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- debug:
    msg: "server name {{ item.Name }}, moid {{ item.Moid }}"
  loop: "{{ intersight_servers }}"
  when: intersight_servers is defined
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get facts for servers by name
  intersight_facts:
    api_private_key: ~/Downloads/SecretKey.txt
    api_key_id: 64612d300d0982/64612d300d0b00/64612d300d3650
    server_names:
      - SJC18-L14-UCS1-1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- debug:
    msg: "server moid {{ intersight_servers[0].Moid }}"
  when: intersight_servers[0] is defined

Inputs

    
api_uri:
    default: https://intersight.com/api/v1
    description:
    - URI used to access the Intersight API.
    type: str

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

api_key_id:
    description:
    - Public API Key ID associated with the private key.
    required: true
    type: str

server_names:
    description:
    - Server names to retrieve facts from.
    - An empty list will return all servers.
    required: true
    type: list

validate_certs:
    default: true
    description:
    - Boolean control for verifying the api_uri TLS certificate
    type: bool

api_private_key:
    description:
    - Filename (absolute path) of a PEM formatted file that contains your private key
      to be used for Intersight API authentication.
    required: true
    type: path

Outputs

intersight_servers:
  contains:
    Moid:
      description: The unique identifier of this Managed Object instance.
      returned: always
      sample: 5978bea36ad4b000018d63dc
      type: str
    Name:
      description: The name of the server.
      returned: always
      sample: SJC18-L14-UCS1-1
      type: str
  description: A list of Intersight Servers.  See L(Cisco Intersight,https://intersight.com/apidocs)
    for details.
  returned: always
  type: complex