Ansible Collection Equinix
Manage Metal resources in event-driven configurations using our growing Ansible collection (provider). Reach out with features you need for your YAML playbooks!

On this page
The Ansible Collection for Equinix contains various plugins for managing Equinix services.
What is it?
This collection of Ansible modules enables workflows for interacting with the Equinix Digital Infrastructure APIs. We have modules for managing Equinix Metal devices, elastic IPs, and projects. Additional modules help you gather info about your Equinix Metal infrastructure to use in your playbooks.
Why do we love it?
- Easy to use
- low bar to entry using simple YAML
- Infrastructure as code that excels in configuration management
- Leverages the powerful Equinix Metal API
- Offers agentless provisioning of infrastructure or can be used with Terraform
- Well-established forum community and use-cases
How do you use it?
The collection is available on Ansible Galaxy and can be installed with the following command:
ansible-galaxy collection install equinix.cloud
The Python module dependencies are not installed by ansible-galaxy. They can be manually installed using pip:
pip install -r https://raw.githubusercontent.com/equinix-labs/ansible-collection-equinix/main/requirements.txt
You will also need an Equinix Metal API token. You can obtain an API token from the Equinix Metal Portal. Set the environment variable METAL_AUTH_TOKEN to your API token:
export METAL_AUTH_TOKEN=your_api_token_here
The following playbook creates a new device in a project you specify.
---
- name: create Equinix Metal device
hosts: localhost
tasks:
- equinix.cloud.metal_device:
project_id: "3b516842-c8b1-485e-9f76-c891bd804c5e"
hostname: "my-new-device"
operating_system: ubuntu_20_04
plan: c3.small.x86
metro: sv
Save this to a file named main.yml and edit it to use your own project ID.
To run the playbook, navigate to the directory containing the playbook file main.yml
and run the following command:
ansible-playbook main.yml
More info can be found at the Ansible Collection for Equinix GitHub repository.
Get support on the Equinix Metal Community Slack and Community Site.
Submit new feature requests on the Equinix Metal Roadmap.
You may also like

Ready to kick the tires?
Sign up and get going today, or request a demo to get a tour from an expert.