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 different machines needing different user accounts or ports to log in with?



How do I handle different machines needing different user accounts or ports to log in with?..

Answer / Kumar Sourav

To handle situations where different machines require different user accounts and/or ports for logging in using Ansible, you can create specific inventory entries for each machine and override the default settings:n1. Define custom inventory entries: In your inventory file, define separate entries for each machine with their respective user account and port.nExample:nhost1:n ansible_user: myusernamen ansible_port: 2222nhost2:n ansible_user: anotherusernamen ansible_port: 3333nn2. Use the custom inventory entries in your playbook: When running tasks, Ansible will use the specified user account and port for each machine.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ansible Interview Questions

How does ansible work?

1 Answers  


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

1 Answers  


How would you install ansible on a centos system?

1 Answers  


How do I loop over a list of hosts in a group, inside of a template?

1 Answers  


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

1 Answers  


What are ad-hoc commands?

1 Answers  


How can you connect other devices within ansible?

1 Answers  


What are the ansible modules? Explain the different types.

1 Answers  


What is ansible role and how are they different from the playbook?

1 Answers  


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

1 Answers  


How can you create a lamp stack and deploy a webpage by using ansible?

1 Answers  


How do I speed up management inside ec2?

1 Answers  


Categories