terraform-provisioner-ansible
terraform-provisioner-ansible copied to clipboard
support host variables
Playbooks that take advantage of host variables like so
http_port: "{{ default_http_port | default(hostvars[groups['Atlanta'][0]]['http_port']) }}"
would need an inventory that has host variables like so
[atlanta]
host1 http_port=80 maxRequestsPerChild=808
host2 http_port=303 maxRequestsPerChild=909
Hi @sjwl, definitely something to investigate. Thank you for reporting.
My workaround is using a seperate null_resource with the ansible provisioner for each instance I want to provision with Ansible.
That way I can pass specific vars per host through the extra_vars of the ansible provisioner.
I will take a look at this. Ideas are welcomed, though. Maybe there is an alternative, more intuitive may for handling this.