What is the correct format to use filters parameter in Ansible ad-hoc mode

62 views
Skip to first unread message

Henry Huang

unread,
Jul 11, 2016, 6:23:00 PM7/11/16
to Ansible Project
I am trying to test the filter result using the ansible command in ad-hoc mode for ec2_vpc_subnet_facts module. I can't seem to get the "filters" parameter to work in the ad-hoc mode somehow. It keeps giving me back key value error or "unable to evaluate dictionary for filters" kind of error no matter how I put those things together. 

Here's is how my command looks like:

ansible localhost -i ./local -m ec2_vpc_subnet_facts -a "profile=my-profile region=us-east-1 filters="{ 'vpc-id': vpc-xxxxx }" -vvvv

And here's the error message:

localhost | FAILED >> {
    "failed": true,
    "msg": "this module requires key=value arguments (['filters={', 'vpc-id:', 'vpc-xxxxx', '}'])"
}

I have played with many different formatting but I just can't get it to work. 

Henry Huang

unread,
Jul 15, 2016, 2:58:05 PM7/15/16
to Ansible Project
Does anyone know?
Reply all
Reply to author
Forward
0 new messages