I used the delegate to localhost to create a CSV report of inventory details. HTH

Mike

On Nov 16, 2022, at 07:40, saravanan jothilingam <[email protected]> wrote:


Thanks for this input.
Could you please share one sample playbook code which does that? Appreciate your help!

On Wed, Nov 16, 2022 at 5:43 PM 'Rowe, Walter P. (Fed)' via Ansible Project <[email protected]> wrote:
The command module runs the ping. It won't display the output you register in ping_result. You need a debug task if you want to see the result. If you want formatted output you may want to look at using a jinja2 template.

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

On Nov 15, 2022, at 11:11 PM, saravanan jothilingam <[email protected]> wrote:

We have around 300+ on-prem linux servers to manage its availability. We found ansible is one easy tool to manage it.

On Wed, Nov 16, 2022 at 9:20 AM Dick Visser <[email protected]> wrote:
Hi
What is the reason you need to use ansible for this?

On Wed, 16 Nov 2022 at 04:09, saravanan jothilingam <[email protected]> wrote:
Hi,
I need to get the ping status of all remote hosts and print its results in one neat tabular column format. Since I am a novice to ansible, I am looking for the appropriate playbook which does this. 

note - the below task doesnt give any clear output .
- name: check reachable hosts
  hosts: remote-hosts
  gather_facts: no
  tasks:
    - command: ping -c1 {{ inventory_hostname }}
      delegate_to: localhost
      register: ping_result

Thanks

saravanan

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAE7H9qoRWWw%3D1gbLETVztDvWrgC_hupW_X_7OxJWTAc70mRvSw%40mail.gmail.com.
--
Sent from Gmail Mobile

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAF8BbLZDyGa7VpRiQ5f1%3D%3Dup1CBb32pRDu_6vHULW_BOhNR%2BBA%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAE7H9qp9%3DiwQeekbLTHeBRZXqGntff19SxtqUfjVt4Z63_q0vg%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/AE75345F-80D8-43CB-BB4F-CEFBC41A9352%40nist.gov.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAE7H9qpyudHd6k4x52fm1%2Bheh0fPzdPP1TycfNRAMc_LPjdUhg%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/782605B0-D5BA-459B-AB1D-A84019E4B08D%40gmail.com.

Reply via email to