equinix.metal.project (1.4.1) — module

Create/delete a project in Equinix Metal

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

Authors: Tomas Karasek (@t0mk) <tom.to.the.k@gmail.com>, Nurfet Becirevic (@nurfet-becirevic) <nurfet.becirevic@gmail.com>, 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

Create/delete a project in Equinix Metal.

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


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 the api token in module param api_token.

- name: Create new project
  hosts: localhost
  tasks:
    equinix.metal.project:
      name: "new project"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create new project within non-default organization
  hosts: localhost
  tasks:
    equinix.metal.project:
      name: "my org project"
      org_id: a4cc87f9-e00f-48c2-9460-74aa60beb6b0
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove project by id
  hosts: localhost
  tasks:
    equinix.metal.project:
      state: absent
      id: eef49903-7a09-4ca1-af67-4087c29ab5b6
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create new project with non-default billing method
  hosts: localhost
  tasks:
    equinix.metal.project:
      name: "newer project"
      payment_method: "the other visa"

Inputs

    
id:
    description:
    - UUID of the project which you want to remove.
    type: str

name:
    description:
    - Name for/of the project.
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Indicate desired state of the target.
    type: str

org_id:
    description:
    - UUID of the organization to create a project for.
    - When blank, the API assumes the default organization.
    type: str

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

custom_data:
    description:
    - Custom data about the project to create.
    type: str

payment_method:
    description:
    - Payment method is name of one of the payment methods available to your user.
    - When blank, the API assumes the default payment method.
    type: str

Outputs

changed:
  description: True if a project was created or removed.
  returned: success
  sample: true
  type: bool
id:
  description: UUID of addressed project.
  returned: success
  type: str
name:
  description: Name of addressed project.
  returned: success
  type: str