in Ansible by
What is the way to access shell environment variables in Ansible?

1 Answer

0 votes
In Ansible, if you want to access existing variables, then you need to use the 'env' lookup plugin.

For example, you want to access the value of the Office environment on the management machine, as shown in the following command, such as:


# ...  


local_home: "{{ lookup('env','Office') }}"  


{{ ansible_env.SOME_VARIABLE }}
Click here to read more about Ansible
Click here to read more about Insurance

Related questions

0 votes
asked Nov 5, 2019 in Ansible by Robin
0 votes
asked Nov 13, 2019 in Ansible by rajeshsharma
0 votes
asked Mar 3, 2020 in React JS by miceperry
+1 vote
asked May 8, 2020 in Ansible by SakshiSharma