Attaching a Floating IP
Floating IP addresses are movable IPs that can be moved around from droplet to droplet as required. This can be helpful to route traffic away to a healthy droplet in case a droplet turns bad.
How to do it…
- Let's create a floating IP and attach it to the droplet:
- name: attach a floating IP digital_ocean_floating_ip: state: present droplet_id: "{{ app_droplet.droplet.id }}" api_token: "{{ DO_OAUTH_TOKEN }}"
This task takes droplet_id
as a parameter and attaches a floating IP
to it.