I am trying to configure a server on AWS using ansible with a dynamic inventory script.
I created an ec2 instance which works fine and which I can manually ssh into. However, when trying to reach the instance (just to ping or to install software) I run into trouble.
ansible -i ec2.py all -m ping
xx.xx.xx.xx | FAILED! => {
"changed": false,
"failed": true,
"module_stderr": "Shared connection to xx.xx.xx.xx closed.\r\n",
"module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n",
"msg": "MODULE FAILURE",
"rc": 0
}
and for
ansible-playbook deploy_site.yml -i ec2.py all
ERROR! the playbook: all could not be found
my all file lives in the directory group_vars
playbook
- deploy_site.yml
/group_vars
-all
and looks like
ansible_user: ubuntu
ansible_ssh_private_key_file: ~/.ssh/key_pair.pem
my key_pair.pem file exists and with mod=600
All of this happens in a virtual environment specific ansible and both host and server are ubuntu 16.04.
Any thoughts on the reason for the connection problem?