On 02.08.2016 18:20, P Retzel wrote:
From page 28 in the book "Ansible for DevOps", the author says to try
the
following examples:
$ ansible multi -s -a "service ntpd stop"
$ ansible multi -s -a "ntpdate -q 0.rhel.pool.ntp.org"
$ ansible multi -s -a "service ntpd start"
Unfortunately, they each fail with the message:
myservername | FAILED | rc=127 >>
/bin/sh: service: command not found
Is the author's example broken? Or am I doing something wrong?
The commands is correct, it's you environment that needs a change.
Naturally, I don't want to memorize (or type) the full path of each
command that I'm issuing ad-hoc. I think that's the point of ad-hoc
commands. It's supposed to be like sitting at the command line of the
server(s) in question. Right?
How do I get the PATH included in my environment such that I can get
these ad-hoc commands to work without including the full path in each
command? Is there a way to set the path in an inventory file or the
ansible.cfg file?
Any advice would be appreciated. Thanks!
Ansible will log in to the host with a user and in your case do a sudo.
This user don't have the correct path set and you will need to write
full path until you sort that out.
--
Kai Stian Olstad
--
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/afd6cb3e7af6be1c659f7ae5c02c257c%40olstad.com.
For more options, visit https://groups.google.com/d/optout.