Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How do I handle python pathing not having a python 2.x in /usr/bin/python on a remote machine?



How do I handle python pathing not having a python 2.x in /usr/bin/python on a remote machine?..

Answer / Raghuveer Singh

To ensure that the correct version of Python is used when running Ansible tasks on a remote machine without Python 2.x in the default location, you can specify the Python interpreter explicitly:n1. Define python_interpreter: In your ansible.cfg file or in your playbook's inventory, define the python_interpreter variable to point to the specific Python version you want to use.nExample for ansible.cfg:n[defaults]npython_interpreter=/path/to/your/python3nn2. Use the defined interpreter: In your playbook tasks, use the python module with the python_interpreter variable:n- name: Run a Python scriptn python: /path/to/your/script.pyn vars:n python_interpreter: '{{ ansible.python_interpreter }}'

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ansible Interview Questions

How would you install ansible on a centos system?

1 Answers  


What is the way to access shell environment variables in ansible?

1 Answers  


What is ansible role?

1 Answers  


When should I use {{ }}?

1 Answers  


Is it possible to build our modules in ansible?

1 Answers  


How do I see all the inventory vars defined for my host?

1 Answers  


How ansible works?

1 Answers  


How can looping be done over a list of hosts in a group, inside of a template?

1 Answers  


Explain what are playbooks in ansible? Explain with some examples.

1 Answers  


How do I access a variable of the first host in a group?

1 Answers  


What is the difference between a variable name and an environment variable?

1 Answers  


How can one interpolate variables or dynamic variable names?

1 Answers  


Categories