I’m developing an Ansible module to manage Floating IPs, (that can be) assigned to a droplet from a pool of “gates”. My problem is when I run the playbook again how can I know if there is already any Floating IP assigned to one of the droplets in that pool? Tags only support “droplets” type, at least is what is documented https://developers.digitalocean.com/documentation/v2/#tag-a-resource
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
The only method currently supported by the API for checking whether there exists a floating IP assigned to a given droplet is to iterate over all floating IPs in the account (which won’t take long; normal accounts can only have three floating IPs at once) and see if the
droplet
field on any of them equals the droplet in question.