Categories

Nov 5, 2019 in Ansible

Q: How do you access Shell Environment Variables?

1 Answer

Nov 5, 2019
If you are just looking to access the existing variables then you can use “env” lookup plugin.

For example:

Accessing the value of Home environment variable on management machine:

local_home:”{{lookup(‘env’,’HOME’)}}”
Click here to read more about Ansible
Click here to read more about Insurance

Related questions

Madanswer
May 14 in DevOps
Oct 7 in Ansible
Sep 19, 2019 in Ansible
...