Just wanted to summarize some of the other discussion that we had recently 
in the #ansible channel:

P Retzel noted that placing the following at the top of his ~/.bashrc file 
allowed commands to be executed properly:

export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin


Note that on most of the servers I've provisioned—mostly using the standard 
minimal base images for CentOS, Debian, or Ubuntu, on different cloud 
providers or via Vagrant, the $PATH seems to be configured correctly out of 
the box to include the 'service' command and other paths, so I'm guessing 
something else in the environment on P Retzel's servers may be custom that 
caused the path to not work correctly (I believe he mentioned using CentOS 
6.8 somewhere).


Just wanted to summarize the info here for the benefit of anyone else 
coming to this thread :)


-Jeff Geerling


P.S. Thanks for buying the book!



On Wednesday, August 3, 2016 at 12:51:57 PM UTC-5, P Retzel wrote:
>
> On Wednesday, August 3, 2016 at 3:24:09 AM UTC-4, Kai Stian Olstad wrote:
>  
>
>> 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. 
>>
>>
> Is there a reason why Ansible uses /bin/sh? (per the error message above.) 
>
> When I SSH into the machine, it launches /bin/bash as my shell. Is there a 
> way to tell Ansible to use /bin/bash instead? (which should then source 
> /etc/profile which in turn sets the full path.)
>

-- 
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/f3be3da7-3d5a-4f1b-8e41-9e3a30782805%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to