I think this has been discussed before. The documentations says:
"If you want to run a command through the shell (say you are using <, >, |,
etc), you actually want the shell module instead. The command module is
much more secure as it’s not affected by the user’s environment."
Implicitly, I read this as if I *do* use the shell command, I should get
the users environment. Is this assumption wrong?
Now I do this, occasionally, in order to include anything from my user
profile:
shell: . ~/.bashrc && env > /tmp/env
The use case I have is to install a mule license, which requires MULE_HOME.
I could write a two line wrapper, but I'd rather not have more parts than I
can get away with. I do as follows:
shell: . ~/.bashrc && ./mule -installLicense {{ mule_user_home
}}/mule-ee-license.lic chdir={{ mule_home }}/bin
--
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/82685bf4-80ba-4e82-932d-0a5c4c8e5d53%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.