Help creating an ansible playbook

Hello everyone,

I am new to ansible but I am really enjoying it. I am trying to create a playbook to spin up new droplets (servers) at DigitalOcean. I have the following playbook put together and I need a little help.

My first task “Create new staging droplets” works very well, but I need to create a DNS record for each server that is created and I am not sure how to go about this. I am starting to think that using a “with_items” dictionary isn’t the best way to go about this. In the end, I just need to make a call with the digital_ocean_domain module for each server with its newly assigned IP address.

Can someone help steer me in the right direction?