I’ve been having issues with the ‘{{ var }}’ format and yaml compatibility so I’ve had to mix-and-match ${ var } syntax. Perhaps I just always need to use curlies quoted like “{{ var }}”?
I might be misunderstanding with setting $hosts, so here’s my complete playbook (launch-ec2.yml):
Launches an EC2 instance and provisions it as the specified role