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,180 points
6,060 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,240 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 25, 2019 in Ansible by Haider
1,520 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,240 points
5,755 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,240 points
1,383 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,240 points
1,024 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,193 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,240 points
189 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,240 points
3,933 views