Ansible: Shared connection to xxx closed
<p>Hello guys I make a simple playbook to practice with Ansible but I have a problem when I try to run the playbook (<code>ansible-playbook -i hosts.ini playbook.yml</code>) to configure an instance ec2 the output returns: </p>

<pre><code>&gt; fatal: [XX.XXX.XXX.XXX]: FAILED! =&gt; {
&gt;     "changed": false, 
&gt;     "failed": true, 
&gt;     "invocation": {
&gt;         "module_name": "setup"
&gt;     }, 
&gt;     "module_stderr": "Shared connection to XXX.XXX.XXX.XXX closed.\r\n", 
&gt;     "module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n", 
&gt;     "msg": "MODULE FAILURE" }     to retry, use: --limit @/home/douglas/Ansible/ansible_praticing/projeto2.retry
&gt; 
&gt; PLAY RECAP
&gt; *********************************************************************
&gt; XX.XXX.XXX.XXX             : ok=0    changed=0    unreachable=0    failed=1
</code></pre>

<p>When I try to connect with the instance via <code>ssh -i ~/.ssh/key.pem ubuntu@public.ip</code> it works well but the provisioning not.</p>

<p>My playbook:</p>

<pre><code>- hosts: projeto
  sudo: True
  remote_user: ubuntu
  vars_files:
    - vars.yml

  tasks:
    - name: "Update"
      apt: update_cache=yes

    - name: "Install the Ansible"
      apt: name=ansible state=latest

    - name: "Installt the mysql"
      apt:
      args:
        name: mysql-server
        state: latest

    - name: "Install the Nginx"
      apt:
      args:
        name: nginx
        state: latest
</code></pre>

<p>My <code>hosts.ini</code> is also ok (with public ip of aws ec2 instance) and I put the public key (<code>~/.ssh/id_rsa.pem</code> of local machine) in the <code>~/.ssh/authorized_keys</code> file, inside of the instance.</p>

<p>In the last week (Friday) this playbook was working well.</p>

<p>What am I doing wrong? </p>