Where are you defining those variables that you expect to be resolved by
instance_tags? For example, are you doing it in host_vars/localhost?
BTW, have you had a look at http://docs.ansible.com/ec2_tag_module.html?
On Tuesday, 6 January 2015 20:14:00 UTC+1, Eli Finkelshteyn wrote:
>
> By the way, I'm on 1.8.2, in case that helps.
>
> On Tuesday, January 6, 2015 2:36:50 AM UTC-8, Eli Finkelshteyn wrote:
>>
>> In Ansible, if I try to use a variable as a parameter name, or a key
>> name, it is never resolved. For example, if I have `{{ some_var }}: true`,
>> or:
>>
>> template: "{{ resolve_me_to_src }}": "some_src"
>>
>> the variables will just be used literally and never resolve. My specific
>> use case is using this with the ec2 module, where some of my tag names are
>> stored as variables:
>>
>> - name: Provision a set of instances
>> ec2:
>> group: "{{ aws_security_group }}"
>> instance_type: "{{ aws_instance_type }}"
>> image: "{{ aws_ami_id }}"
>> region: "{{ aws_region }}"
>> vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
>> key_name: "{{ aws_key_name }}"
>> wait: true
>> count: "{{ num_machines }}"
>> instance_tags: { "{{ some_tag }}": "{{ some_value }}", "{{
>> other_tag }}": "{{ other_value }}" }
>>
>> Is there any way around this? Can I mark that I want to force evaluation
>> somehow?
>>
>> Eli
>>
>
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/5de002ab-3660-43a1-a7cc-13559a5fb2fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.