I'm trying to install a package on a system running a Debian Jessie-based 
distribution called OSMC <https://osmc.tv/>.

This task (run with ansible_sudo == true):

- name: ensure Vim is installed
  apt: name=vim state=present


causes this to happen:

TASK: [vim | ensure Vim is installed] 
***************************************** 
failed: [XXX] => {"failed": true}
stderr: E: Sub-process /usr/bin/dpkg returned an error code (2)

stdout: Reading package lists...
...
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
dpkg: error: 2 expected programs not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and 
/sbin

msg: '/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o 
"Dpkg::Options::=--force-confold"   install 'vim'' failed: E: Sub-process 
/usr/bin/dpkg returned an error code (2)


It seems that something is mangling the PATH before apt-get is called, 
because if I SSH manually into this system:

$ which ldconfig start-stop-daemon
/sbin/ldconfig
/sbin/start-stop-daemon
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/opt/vc/bin
$ sudo sh -c 'echo $PATH'
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/opt/vc/bin


the PATH is correct and I have no problem installing the package manually.

What can I do to improve this situation?

-- 
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/f23313bc-4182-495f-9c9c-c61a0b8b6aa4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to