How to list down all the hosts in Ansible

0 votes

Hi Guys,

I am new in Ansible. I want to list down all the hosts. How can I do that?

Jul 28, 2020 in Ansible by akhtar
• 38,260 points
48,219 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use the option --list-hosts. It will show all the host IPs from your inventory file. You can use the below-given command.

$ ansible all --list-hosts

I hope this will help you.

answered Jul 28, 2020 by MD
• 95,460 points

Related Questions In Ansible

0 votes
1 answer

Playbook to add hosts to the known hosts list - Ansible

Hey @Kiran, try something like this: - name: ...READ MORE

answered Mar 26, 2019 in Ansible by Haider
3,321 views
0 votes
1 answer

How to capture the output of a task in Ansible Playbook?

Hi@akhtar, Ansible registers module used to capture/store the ...READ MORE

answered Aug 2, 2020 in Ansible by MD
• 95,460 points
15,046 views
0 votes
1 answer

How to find the memory of remote systems using the setup module in Ansible?

Hi@akhtar, You need to use the setup module to ...READ MORE

answered Aug 10, 2020 in Ansible by MD
• 95,460 points
5,881 views
0 votes
1 answer

How to run Ansible-Playbook in the localhost?

Hi@akhtar, To run any playbook in the local ...READ MORE

answered Aug 11, 2020 in Ansible by MD
• 95,460 points
2,805 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 to list down all the roles in Ansible?

Hi@akhtar, Ansible role is a part of ansible-galaxy. ...READ MORE

answered Aug 20, 2020 in Ansible by MD
• 95,460 points
8,019 views
0 votes
1 answer

How to overwrite the content of a file in remote systems using Ansible playbook?

Hi@akhtar, You can find one argument in the ...READ MORE

answered Aug 2, 2020 in Ansible by MD
• 95,460 points
14,401 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