Beginner: Ansible on OSX module path not found

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

Hello Anatol,

You're close :wink: 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!

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

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!