Oops, just noting that I accidentally mistyped the instance_filter line in
the second error above (The filter '~Platform' is invalid").

On Mon, Aug 22, 2016 at 11:14 AM, Guy Knights <[email protected]> wrote:

> I'm trying to remove certain ec2 hosts from having ansible run on them by
> using the instance_filters and/or pattern_exclude options in the ini file
> for ec2.py, but it doesn't seem to be working. I tried using the following
> syntax for instance_filters:
>
> instance_filters = "tag:Environment=prod,!Platform=windows"
>
> However when I run a playbook it gives me the following error:
>
> The filter '!Platform' is invalid", while: getting EC2 instances
> inventory/prod/ec2.py:3: Error parsing host definition ''''': No closing
> quotation
>
> I removed the double quotes and I get a similar error:
>
> The filter '~Platform' is invalid", while: getting EC2 instances
> inventory/prod/ec2.py:3: Error parsing host definition ''''': No closing
> quotation
>
> I also tried changing them to single quotes but once again got yet another
> slightly different error:
>
> The filter ''tag:Environment' is invalid", while: getting EC2 instances
> inventory/prod/ec2.py:3: Error parsing host definition ''''': No closing
> quotation
>
> Meanwhile, I tried playing with pattern_exclude instead. I added the
> following:
>
> pattern_exclude = '*-ad'
>
> When I run this, it still tries to excute the playbook on servers whose
> names match the pattern 'example-ec2-ad'.
>
> What am I doing wrong here?
>
> Thanks,
> Guy
>
>
>

-- 
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/CANNH9mt%2BfTpOPawOxCOi%3D%2B5LNzA%2BzAdaXHw3KnM%3DsiETyjr-9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to