the answer was to change hosts file to: [ec2] ip-10-200-2-21.us-west-2.compute.internal
and change the command to: ansible ec2 -m ping -i /etc/ansible/hosts On Wednesday, March 13, 2019 at 2:45:19 PM UTC-7, [email protected] wrote: > > > Hello, > > I am unable to run the example ad hoc command: > > ansible -m ping hosts --private-key=~/home/ec2-user/ -u ec2-user > > > the error is: [WARNING]: Could not match supplied host pattern, ignoring: > hosts > > > The hostname is: ip-10-200-2-21.us-west-2.compute.internal > The host ip is: 10.200.2.21 > > I can ping the host from my ansible control node OS by this hostname. > > I created the hosts file with the touch command and it looks like this: > > ip-10-200-2-21.us-west-2.compute.internal > > > Do I need to include something more? Do I need to save it with a > particular extension? Thank You much for any help. > -- 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 post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/320a0f89-ecb8-4b6f-a584-b371a2416e1c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
