On 22.09.2016 11:38, Harald Kubota wrote:
Thanks Kai for the reply. Unfortunately it does not solve the problem. When
using /bin/sh which is a link to /bin/dash, or when using /bin/bash, it
seems that none of the user's profile files is used.


A shell do distinguish between a login mode and a interactive mode.

When you manual log in with ssh, you get a login shell, and a dash login shell do read /etc/profile and .profile.

When Ansible start a shell its not a login shell, but a interactive dash shell do not read /etc/profile and .profile.
It read the environment ENV if it exist.

You can read more about this in "man dash" and "man bash", search for "Invocation".


I cannot modify /etc/pam.d/* or /etc/ssh/sshd* because everything works
just fine when using ssh by itself as the same user I use for ansible.

I didn't suggest you change any of this files.
I tried to explain that some distribution do use files in /etc/pam.d to inject parameters in some situations.

And that in Kubuntu this is the file /etc/environment, and since it based on Debian it's probably the same file for you, but I can't confirm it since I do not have Debian 8.5.


If it's up to me, this is a bug as I find no reason why it should behave
like it does when I run ansible as a normal user.

It has nothing to do with Ansible, its just how the shells work.


--
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/442fc180bc2082c38c1a85fb62fc46bc%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to