Beginner: Ansible on OSX module path not found

539 views
Skip to first unread message

Anatol

unread,
Feb 1, 2015, 10:24:17 AM2/1/15
to ansible...@googlegroups.com
Hi,

I´ve followed the install instractions (via pip) on OSX yosemite. 
Created an ansible_hosts.txt file

and run successfully:

ansible --ask-pass all -m  ping

82.137.158.111 | success >> {
   
"changed": false,  
   
"ping": "pong"
}


Trying the next ad-hoc command example:

ansible --ask-pass all -m  "/bin/echo hello"

ends in :

82.137.158.111 | FAILED => module /bin/echo hello not found in configured module paths


Where 82.137.158.111 (Ip changed) is an Ubuntu 12.04 Server.

What am I doing wrong?

– Anatol

Mark Phillips

unread,
Feb 1, 2015, 12:08:59 PM2/1/15
to ansible...@googlegroups.com
Hello Anatol,

You're close ;) Read over the getting started guide and you'll spot your mistakes. But to help get you going ...

You need to specify -i for that hosts txt file - do a --help to understand the switch.

-m specifies an ansible module - see module documentation at docs.ansible.com, or try ansible-doc -l. I suspect what you wanted to do there to test was -a - which is switches to a given module. If you don't specificy a module with -m it will default to the 'command' module.

Good luck, and welcome to the community!

Anatol

unread,
Feb 1, 2015, 12:27:10 PM2/1/15
to ansible...@googlegroups.com
Hi Mark,

thanks for your answer!

You need to specify -i for that hosts txt file - do a --help to understand the switch.

I did this already with 

export ANSIBLE_HOSTS=/path/to/file

Which should do the job of -i, right?

do there to test was -a - which is switches to a given module. If you don't specificy a module with -m it will default to the 'command' module.

Unfortunately the VM where I´me testing is down for cloning right now. But if I´m understanding your answer correctly – and after a look into the module docs I´ve missed the -a switch … will try when the Server is back online.

ansible --ask-pass all -m -a "/bin/echo hello"

Thanks for your help!

- Anatol
 

Anatol

unread,
Feb 1, 2015, 12:33:01 PM2/1/15
to ansible...@googlegroups.com
Ahhh tried it on localhost:

ansible all -a "/bin/echo hello"

Doing the job … so far so good. Let´s dive into the docu!

Thanks again!

Reply all
Reply to author
Forward
0 new messages