terraform-ansible-example
terraform-ansible-example copied to clipboard
Provisioning doesn't work when changing count value
When you increase count value, new instances are not provisioned. When decreasing the value, you get an error. The cause of the error is Ansible provisioning.
The cause of the problem is probably ec2.py, which is not the best way to provision in the first place. Problems with this approach:
- We can work only with AWS, but not other cloud providers
- It's based on the information fetched from AWS and not on the state file
We need to find a way to base inventory file on the state created by terraform. At the same time, we need to be able to use remote state. This script seems to fit the bill