Ansible ping module

@Inderpreet @KodeKloud @mmumshad

I’m trying to ping to app server 1 using the given inventory file but I keep getting an inventory parse error.

Is this a bug?

Try without mentioning inventory file.

or write path of your inventory location in ansible.cfg file.
inventory = /home/thor/ansible/inventory

This is error I got:

After adding inventory location in ansible.cfg:

try with -vv and share that o/p here.

create ansible.cfg in /home/thor/ansible directory and write inventory location there. under [defaults]

Screenshot (144)

Last and final
put stapp02 to into group
stapp02 ansible_host= ansible_ssh_pass=Americ@ ansible_user=steve

in ansible.cfg or inventory file?

In inventory file …

Any updates on this?

Write entry of your inventory location in /etc/ansible/ansible.cfg and make a group of one like you did.
stapp01 ansible_host…
then perform this.
Don’t overwrite original ansible.cfg location.

Add to your host file the ip of server

vi /etc/hosts stapp01

You have mention the inventory path in ansible command because you not created inventory file in default path. Use this command
ansible stapp01 -i /home/Thor/ansible/inventory -m ping
And also you have make stapp01 in one group or host example
Then use client instead of stapp01 in ansible command.