Once I had to do something similar and the workaround I used was a
command action calling bash with the -l option, e.g.:
$ ansible server -m command -a "bash -l -c 'env'"
Will print all existent variables, and the -l (makes bash start as a
login shell) forces it to read the .bash_profile (and I also think it
forces reading the .bashrc file too).
I ended moving all environment variables to files in /etc/profile.d
that are sourced by the shell even without the -l or -i options.
On Sun, Apr 12, 2015 at 9:23 PM, Anand Sharma <
anand....@gmail.com> wrote:
> Just curious: Were you able to figure a way around this??
>
> --
> 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-proje...@googlegroups.com.
> To post to this group, send email to
ansible...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/59139a35-53a9-4bb5-9cd0-f04ce3c2f294%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
--
Ivan Sichmann Freitas