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/CANNH9mv6HGitEjPFqRW8ME%2Be9-bsO80mCRGm%2BKC98Edsqkd%3DhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to