$ansible prod --user=ec2-user --private-key=key.pem -m shell -a 'echo "Hello"'
www.myserver.com | FAILED => failed to open a SFTP connection
$ansible prod --user=ec2-user --private-key=key.pem -m shell -a 'echo "Hello"' -c ssh
prod1.v2.pixieplug.com | FAILED => failed to transfer file to /home/ec2-user/.ansible/tmp/ansible-1353110320.71-241956472283584/command:
Couldn't read packet: Connection reset by peer
$ansible prod --user=ec2-user --private-key=key.pem -m shell -a 'echo "Hello"'
prod1.v2.pixieplug.com | FAILED => failed to open a SFTP connection
$ansible prod --user=ec2-user --private-key=key.pem -m shell -a 'echo "Hello"' -c ssh
www.myserver.com | FAILED => failed to transfer file to /home/ec2-user/.ansible/tmp/ansible-1353110453.09-107376501006560/command:
Connecting to www.myserver.com...
// motd that I expect from my server, so it got in //
subsystem request failed on channel 0
Connection closed
$ansible-playbook test.yml --user=ec2-user --private-key=key.pem
PLAY [prod] *********************
GATHERING FACTS *********************
fatal: [www.myserver.com] => failed to open a SFTP connection
TASK: [print hello world] *********************
FATAL: no hosts matched or all hosts have already failed -- aborting
PLAY RECAP *********************
www.myserver.com : ok=0 changed=0 unreachable=1 failed=0
ansible-playbook test.yml --user=ec2-user --private-key=key.pem -c ssh
PLAY [prod] *********************
GATHERING FACTS *********************
fatal: [www.myserver.com] => failed to transfer file to /tmp/ansible-1353111690.46-131535236804596/setup:
Connecting to www.myserver.com...
// motd //
subsystem request failed on channel 0
Connection closed
TASK: [print hello world] *********************
FATAL: no hosts matched or all hosts have already failed -- aborting
PLAY RECAP *********************
www.myserver.com : ok=0 changed=0 unreachable=1 failed=0
# The default is incorrect# Subsystem sftp /usr/lib/openssh/sftp-serverSubsystem sftp /usr/libexec/openssh/sftp-server
sudo /etc/init.d/sshd restart