Ansible – accessing local environment variables

I have a Linux vm running on osx, and for me:

lookup('env', 'HOME') returns “/Users/Gonzalo” (the HOME variable from osx), while ansible_env.HOME returns “/root” (the HOME variable from the vm).

Worth to mention, that ansible_env.VAR fails if the variable does not exists, while lookup('env', 'VAR') does not fail.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)