I am provisioning AWS infrastructure using terraform and want to pass variables such as aws_subnet_id
and aws_security_id
into ansible playbook usi
Use terraform outputs - https://www.terraform.io/intro/getting-started/outputs.html (it is not clear if you are using it already)
Then using command like terraform output ip
, you can then use those values in your scripts to generate or populate other files like inventory files or vars_file.
Another option is to use terraform templates and render your files like inventory files from terraform itself and then use it from Ansible.