I'd like to access a variable set by the ec2.py dynamic inventory script in a Jinja2 template, but I can't work out how to do it.
ec2.py returns a variable called ec2_tag_elasticbeanstalk_environment-name for EC2 instances that are part of an Elastic Beanstalk environment: ec2.py --host=ec2-54-196-159-144.compute-1.amazonaws.com { "ec2__in_monitoring_element": false, "ec2_ami_launch_index": "0", "ec2_architecture": "x86_64", ...snip "ec2_tag_elasticbeanstalk_environment-name": "production", "ec2_virtualization_type": "paravirtual", "ec2_vpc_id": "" } I'd like to access that variable in a template I'm running as part of a playbook on that host: - name: Create Diamond conf file template: src=diamond_elasticbeanstalk.conf.j2 dest=/etc/diamond/diamond.conf notify : - restart diamond The template contains: path_prefix = servers.{{ ec2_tag_elasticbeanstalk_environment-name }} I'm guess I have the wrong syntax, but I can't find anywhere in the docs that tells me the correct approach. Roger -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2f8ca4f4-0e55-4078-aff2-79e51aa16912%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.