title: Ansible postgresql_db task fails after a very long pause
body: <p>The following ansible task (in a vagrant VM) fails :</p>
  
  <pre><code>- name: ensure database is created
    postgresql_db: name={{dbname}}
    sudo_user: postgres
  </code></pre>
  
  <p>the task pauses for a few minutes before failing
  the vagrant VM is a centos6.5.1, 
  the tasks output is :</p>
  
  <pre><code>TASK: [postgresql | ensure database is created] ******************************* 
  fatal: [192.168.78.6] =&gt; failed to parse: 
  We trust you have received the usual lecture from the local System
  Administrator. It usually boils down to these three things:
  
      #1) Respect the privacy of others.
      #2) Think before you type.
      #3) With great power comes great responsibility.
  
  [sudo via ansible, key=glxzviadepqkwddapvjheeuillbdakly] password: 
  
  
  FATAL: all hosts have already failed -- aborting
  </code></pre>
  
  <p>I have verified that postgres is prooperly installed 
  by doing vagrant ssh and connecting vial psql.</p>
  
  <p>I also validated that I can do a "sudo su postgres" within the VM ...</p>
  
  <h2>========  update</h2>
  
  <p>It looks like the problem is the sudo_user: postgres, because removing the
  above postgres tasks and replacing with this one causes the same problem :</p>
  
  <pre><code>- name: say hello from postgress
    command: echo "hello"
    sudo_user: postgres
  </code></pre>
  
  <p>the output is exactly the same as above, so it's really a problem of 
  ansible doing a sudo_user on centos6.5</p>
  
  <p>one interesting observation, although I can do  "sudo su postgres" from
  inside the vm</p>
  
  <p>when I call "psql" (as the postgres user) I get the message : </p>
  
  <p>could not change directory to "/home/vagrant": Permission denied</p>
  
  <p>but the psql shell still starts successfully</p>
  
  <h2>========  conclusion</h2>
  
  <p>Problem was fixed by changing to a stock centos box, </p>
  
  lesson learned : when using ansible/vagrant, only use stock OS images...