Did you find a solution to this by any chance?

I've got exactly the same problem and am beginning to get mighty pissed 
at the amount of useless yak-shaving that isn't even working.

No matter what I try, it looks like the secure_path in the sudoers file 
is ignored somewhere down the call stack.

I did find this reference: https://wiki.debian.org/sudo#PATH_not_set. 
But, I don't seem to have any other sudoers file and this isn't an upgrade.

Completely stumped and reaching the end of my patience with this 
(been at this one issue for literally a week now)

Any help HUGELY appreciated

Thanks
Alastair

On Thursday, 14 May 2015 13:27:28 UTC+1, Alex Peters wrote:
>
> I tried running this very verbose command:
>
> ansible -vvv -m setup XXX
>
>
> which caused the following to be output (among other things):
>
> <XXX> EXEC sshpass -d6 ssh -C -tt -v -o ControlMaster=auto -o 
> ControlPersist=60s -o ControlPath=".../.ansible/cp/ansible-ssh-%h-%p-%r" -o 
> GSSAPIAuthentication=no -o PubkeyAuthentication=no -o User=osmc -o 
> ConnectTimeout=10 XXX /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via 
> ansible, key=xidpkckjjfdcsgiewleebdlstyiyzpad] password: " -u root /bin/sh 
> -c '"'"'echo BECOME-SUCCESS-xidpkckjjfdcsgiewleebdlstyiyzpad; LANG=C 
> LC_CTYPE=C /usr/bin/python 
> /home/osmc/.ansible/tmp/ansible-tmp-1431605612.35-230680545785241/setup; rm 
> -rf /home/osmc/.ansible/tmp/ansible-tmp-1431605612.35-230680545785241/ 
> >/dev/null 2>&1'"'"''
>
>
> which prompted me to cut out Ansible altogether and just try this:
>
> $ ssh osmc@XXX /bin/sh -c '"echo $PATH"'
> OSMC: Open Source Media Center
> osmc@XXX's password: 
> /usr/local/bin:/usr/bin:/bin:/usr/games
>
>
> $ ssh osmc@XXX /usr/bin/sudo -u root /bin/sh -c '"echo $PATH"'
> OSMC: Open Source Media Center
> osmc@XXX's password: 
> /usr/local/bin:/usr/bin:/bin:/usr/games
>
>
> which is a very different PATH to when I log in interactively:
>
> $ ssh osmc@XXX
> OSMC: Open Source Media Center
> osmc@XXX's password: 
> osmc@XXX:~$ echo $PATH
>
> /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/opt/vc/bin
> osmc@XXX:~$ sudo echo $PATH
>
> /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/opt/vc/bin
>
>
> So on the bright side, it doesn't seem to be an Ansible problem after all, 
> which means it's probably out of scope for this discussion group.  Time to 
> read up on the differences between interactive, non-interactive, login and 
> non-login bashsessions, it seems...
>
> Thanks anyway for all of your attention to this point.  I'm sorry to have 
> wasted your time.
>

-- 
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/7ebe49bf-7405-490a-8c98-f7107b2d3205%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to