By tzoiker
Hello!
I am trying to setup a cloud with VPC and want to make it private by restricting access only for internal nodes and avoid using floating IPs (except for vpn server).
The problem is that I can’t rely on private IP addresses to manage ansible inventory, because they can change if I recreate deployment from scratch and even not sure if they may change on reboots.
To handle this, I decided to use ansible DO inventory plugin. It seems to allow dynamic extraction of droplets’ private IP addresses instead of hardcoding them in the inventory.
And here is the dilemma I have on how to manage my setup:
I don’t have much experience, but it seems there is no difference whether to define droplets/firewalls/… using Terraform or using digital_ocean_droplet/digital_ocean_firewall/… from the ansible DO inventory plugin.
So the question is, should I get rid of Terraform to simplify things or I will regret it at some point of time? If so, what are the pros of sticking with Terraform?
Thanks to everyone in advance!
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!
Hey there!
That’s a great question and quite a common dilemma in the world of cloud infrastructure and automation. Let’s dive into your options to find the best fit for your project.
First off, it’s awesome that you’re considering both Terraform and Ansible for your setup – both are fantastic tools in their own right. The key is to understand how they can complement each other in your workflow.
Using Terraform and Ansible Together:
Think of Terraform as the architect that designs and builds the structure, while Ansible is the interior designer that makes sure everything inside works perfectly and looks great.
Going Solo with Ansible:
Some Food for Thought:
Final Thoughts:
It’s all about what works best for your specific needs and context. Both strategies have their merits, and many folks successfully use a mix of Terraform and Ansible.
Hope this helps clear things up a bit! Feel free to reach out if you have more questions.
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.