Hi,

I have been testing ansible along with environment variables, since we 
utilize environment variables for various deployment reasons, I notice that 
on ansible will pick up any environment variables defined under .bashrc as 
thats the file sourced by /bin/login.

But under KSH, the profile file ".profile" is never read, and as such the 
ENV variable is not read, and as such, app/user environment is not visible 
within Ansible.  Is there any suggestions on properly handing such cases?

Does ansible invoke its own "bash" shell, regardless of the ansible_user 
shell?  For instance, if you run this against a KSH user:

ansible xxxxxx -i jet/projects/rbm/rbm_hosts -m shell -a "echo $SHELL"
{'_host': xxxxxx, '_task': TASK: command, '_result': {u'cmd': u'echo 
/bin/bash', u'end': u'2016-05-18 18:20:37.051111', '_ansible_no_log': 
False, u'stdout': u'/bin/bash', u'changed': True, u'start': u'2016-05-18 
18:20:37.047621', u'delta': u'0:00:00.003490', u'stderr': u'', u'rc': 0, 
'invocation': {'module_name': u'command', u'module_args': {u'creates': 
None, u'executable': None, u'chdir': None, u'_raw_params': u'echo 
/bin/bash', u'removes': None, u'warn': True, u'_uses_shell': True}}, 
'stdout_lines': [u'/bin/bash'], u'warnings': []}}
dukerbdv99 | SUCCESS | rc=0 >>
/bin/bash

It returns /bin/bash, yet the user's /etc/passwd clearly indicates it is 
KSH, and when I login, it is KSH.

Can anyone really clarify this for me? 

Thanks in advance,
Ahmed

-- 
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/7a26d59e-1457-4f1a-93be-9e9d268b933b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to