The problem is most likely shell expansion of `*`. You probably have some files in your directory that have `sync` in the name.
echo *proxy* echo *sync* When using chars in a command that could be interpreted by the shell, you should ensure you use quoting such as: ansible '*sync*' -i /tmp/killthis.txt --list-hosts On Tue, May 17, 2016 at 11:40 AM, Kenny Serrine <[email protected]> wrote: > 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 <host-pattern> [options] > > Options: > -a MODULE_ARGS, --args=MODULE_ARGS > [snip] > --version show program's version number and exit > ERROR! Missing target hosts > > > > -- > 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/3f7b60c3-0dc7-4f8f-b8d6-645ea76ba17e%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/3f7b60c3-0dc7-4f8f-b8d6-645ea76ba17e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Matt Martz @sivel sivel.net -- 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/CAD8N0v9V%2BLObPgx%3DxPAVpuqtkdAR9HptQkzcoXfFAZs_M7T-vA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
