It is not possible to complete the following executable task (in a roaming virtual machine):
- name: ensure database is created postgresql_db: name={{dbname}} sudo_user: postgres
the task is suspended for several minutes until the failure of the roaming VM - this is centos6.5.1, the output of the tasks:
TASK: [postgresql | ensure database is created] ******************************* fatal: [192.168.78.6] => 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
I checked that postgres was pre-installed by making a stray ssh and psql connecting bottle.
I also confirmed that I can do "sudo su postgres" inside the VM ...
======== update
It seems like the problem is that sudo_user: postgres, because deleting the postgres tasks and replacing them causes the same problem:
- name: say hello from postgress command: echo "hello" sudo_user: postgres
the output is exactly the same as above, so this is really a problem maybe sudo_user does on centos6.5
one interesting observation, although I can do "sudo su postgres" from inside vm
when I call "psql" (as a postgres user), I get a message:
failed to change directory to "/ home / vagrant": Permission denied
but psql shell still starts successfully
======== conclusion
The problem has been fixed by changing the centos field,
lesson learned: when using inaccessible / wandering, use only OS images ...
postgresql ansible
Max L.
source share