I’m using wildcards to match my hosts, and it works in one case but not in another. I’ve figured out that if I use a regex pattern, I can get consistency. But, for just simple wildcard, I’m wondering if this is a bug or if I’m just doing something that the command line parser wasn’t designed to handle. Maybe the documentation just needs to be clear about the limits of wildcards?
I have version 2.0.2.0 of ansible.
Here is the example hosts file I’m using:
[root@ap01 Scripts]# cat /tmp/killthis.txt
[group1]
myproxy1.example.net
mysync1.example.com
[group2]
myproxy2.example.net
mysync2.example.com
And, here are the commands I’m using. As you can see, proxy seems to work, but sync fails, and ync really fails.
[root@p01 Scripts]# ansible *proxy* -i /tmp/killthis.txt --list-hosts
hosts (2):
myproxy1.example.net
myproxy2.example.net
[root@01 Scripts]# ansible *sync* -i /tmp/killthis.txt --list-hosts
[WARNING]: provided hosts list is empty, only localhost is available
hosts (0):
[root@p01 Scripts]# ansible *ync* -i /tmp/killthis.txt --list-hosts
Usage: ansible [options]
Options:
-a MODULE_ARGS, --args=MODULE_ARGS
[snip]
–version show program’s version number and exit
ERROR! Missing target hosts