equinix.metal.device_info (1.4.1) — module

Gather information about Equinix Metal devices

| "added in version" 1.2.0 of equinix.metal"

Authors: Jason DeTiberus (@detiber) <jdetiberus@equinix.com>

Install collection

Install with ansible-galaxy collection install equinix.metal:==1.4.1


Add to requirements.yml

  collections:
    - name: equinix.metal
      version: 1.4.1

Description

Gather information about Equinix Metal devices.

API is documented at U(https://metal.equinix.com/developers/api/devices/).


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# All the examples assume that you have your Equinix Metal API token in env var METAL_API_TOKEN.
# You can also pass it to the api_token parameter of the module instead.

- name: Gather information about all devices
  hosts: localhost
  tasks:
    - equinix.metal.device_info:
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: Gather information about a particular device using ID
  hosts: localhost
  tasks:
    - equinix.metal.device_info:
      device_ids:
        - 173d7f11-f7b9-433e-ac40-f1571a38037a

Inputs

    
api_token:
    aliases:
    - auth_token
    description:
    - The Equinix Metal API token to use
    - If not set, then the value of the METAL_API_TOKEN, PACKET_API_TOKEN, or PACKET_TOKEN
      environment variable is used.
    required: true
    type: str

hostnames:
    description:
    - One or more hostnames.
    elements: str
    type: list

device_ids:
    description:
    - One or more device ids.
    elements: str
    type: list

project_id:
    description:
    - Project ID.
    required: true
    type: str

Outputs

devices:
  description: Information about each device that was found
  returned: always
  sample: '[{"hostname": "my-server.com", "id": "2a5122b9-c323-4d5c-b53c-9ad3f54273e7",
    "public_ipv4": "147.229.15.12", "private-ipv4": "10.0.15.12", "tags": [], "locked":
    false, "state": "provisioning", "public_ipv6": ""2604:1380:2:5200::3"}]'
  type: list