Assign IP subnet to a bare metal server.
Version added: 1.4.0
- Assign or unassign IPv4 or IPv6 subnets to or from a device in Equinix Metal.
- IPv4 subnets must come from already reserved block.
- IPv6 subnets must come from publicly routable /56 block from your project.
- See https://metal.equinix.com/developers/docs/networking/elastic-ips/ for more info on IP block reservation.
The below requirements are needed on the host that executes this module.
- packet-python >= 1.43.1
# 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: Create 1 device and assign an arbitrary public IPv4 subnet to it
hosts: localhost
tasks:
- equinix.metal.device:
project_id: 89b497ee-5afc-420a-8fb5-56984898f4df
hostnames: myserver
operating_system: ubuntu_20_04
plan: baremetal_0
facility: sjc1
state: active
# Pick an IPv4 address from a block allocated to your project.
- equinix.metal.ip_subnet:
project_id: 89b497ee-5afc-420a-8fb5-56984898f4df
hostname: myserver
cidr: "147.75.201.78/32"
# Release IP address 147.75.201.78
- name: Unassign IP address from any device in your project
hosts: localhost
tasks:
- equinix.metal.ip_subnet:
project_id: 89b497ee-5afc-420a-8fb5-56984898f4df
cidr: "147.75.201.78/32"
state: absent
Common return values are documented here, the following are the fields unique to this module:
- Tomas Karasek (@t0mk) <tom.to.the.k@gmail.com>
- Nurfet Becirevic (@nurfet-becirevic) <nurfet.becirevic@gmail.com>
- Jason DeTiberus (@detiber) <jdetiberus@equinix.com>