What is the difference between the host file and an inventory file in ansible?

0 votes
What is the difference between the host file and an inventory file in ansible?
Feb 9 in Ansible by Keshav
161 views

1 answer to this question.

0 votes
Actually both are same. hosts file is the default inventory file with this default name in ansible after it's installation. We can have multiple inventory files (with any name, can also be a .ini file) and refer to the adhoc commands with -i attribute. We just have to follow the syntax for declaring groups or host names. hosts/inventory file can be in any path in the system where ever ansible command works.
answered Feb 12 by Amith
• 140 points

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer
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
• 6,870 points
478 views
0 votes
1 answer
0 votes
1 answer

Is it possible to run an Ansible Playbook in python script?

Hey @Cerci, Of course its possible. You ...READ MORE

answered Jan 17 in Ansible by Nicolas
1,249 views
+13 votes
2 answers
0 votes
1 answer