Thanks, flowerysong

Did you actually try that?

When I use that, I get the same error as before: An error occurred
(InvalidParameterValue) when calling the DescribeInstances operation: The
filter 'GroupName' is invalid

("GroupName" is the value in my variable tag_name)

If you actually TRIED it and it worked, do let me know.

Here are some things that do not work:

#           "{{ { tag_name: tag_value } }}"
#           "{{ '\"tag:' + tag_name + '\"' }}" : "{{tag_value }}"
#           "{{ 'tag:' + tag_name }}" : "{{tag_value }}"
#           tag: "{{ tag_name + ':' + tag_value }}"
#           tag:"{{ tag_name + ':' + tag_value }}"
#            "{{ tag_name }}" : "{{tag_value }}"

The second last one (no space after the first colon) gives a different
message: "argument filters is of type <type 'str'> and we were unable to
convert to dict: dictionary requested, could not parse JSON or key=value"}

These work - but they have a literal filter name

#           "tag:GroupName" : "DEMO"
#           "tag:GroupName" : "{{tag_value }}"

Thanks, K.

PS: There was a typo in my last message. I meant to write "... at least in
the case of 'tag:Name'"

On Sun, May 6, 2018 at 9:08 AM, flowerysong <[email protected]> wrote:

> On Saturday, May 5, 2018 at 6:57:33 PM UTC-4, Karl Auer wrote:
>>
>> I've tried a LOT of things now, and have come to the conclusion that
>> ec2_instance_facts requires a literal filter name, at least in the case
>> of "tags:Name".
>>
>> This makes that filter essentially useless :-(
>>
>> Please, can someone tell me I'm wrong, and how me how to filter on a
>> tag:value pair passed in as a variable?
>>
>
>     - ec2_instance_facts:
>         filters: "{{ { tag_name: tag_value } }}"
>
>
>
>
> --
> 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/38b14171-3086-4c2d-868f-de3882384090%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/38b14171-3086-4c2d-868f-de3882384090%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Karl Auer

Email  : [email protected]
Website: http://2pisoftware.com

GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA

-- 
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/CA%2B%2BT08TaF7aJZtXuuF6%3DAM3x-ysOMrSjxo0BBkfBUwELO0GEWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to