How do I access shell environment variables using Ansible Playbook

0 votes
How do I access shell environment variables using Ansible Playbook?
Jan 31, 2019 in Ansible by Tina
3,588 views

1 answer to this question.

0 votes

Hey @Tina, If you need to access existing variables on the controller, use the env lookup plugin.

If you need to set env variable for task execution, then edit modules and templates according to your OS and requirements. there is no direct way to achieve this. 

answered Jan 31, 2019 by Mahir

Related Questions In Ansible

0 votes
1 answer

How do I access environment variables in Ansible?

Yes @Nagray, you're right! You can access ...READ MORE

answered Jan 24, 2019 in Ansible by Tessie
8,597 views
0 votes
0 answers

How do I execute MySqL query using Ansible playbook

Dear team, I'm trying to execute MySQL , ...READ MORE

Oct 4, 2021 in Ansible by anonymous
• 140 points
3,249 views
0 votes
1 answer

How do I execute a shell script and then use the result in ansible

This can work out for you: - name: ...READ MORE

answered Apr 11, 2018 in Ansible by shubham
• 7,340 points
6,891 views
0 votes
2 answers

How do i install Ansible using virtualenv

Adding to @Mohit's answer,  For CentOS and RHEL: sudo ...READ MORE

answered Jan 10, 2019 in Ansible by Dikinson
5,580 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,034 views
+2 votes
1 answer
0 votes
1 answer

How do I wget a file from web server using shell in the ansible playbook

Hey Ayaan, you could probably use this ...READ MORE

answered Jan 24, 2019 in Ansible by Anushri
4,155 views
0 votes
1 answer

How do i get Ansible predefined variables?

There three types of variables variables gathered from ...READ MORE

answered Jan 24, 2019 in Ansible by Parth
1,595 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP