railsbox
railsbox copied to clipboard
PostgreSQL ansible error
My first attempt trying to install railsbox, i got this error while running ansible:
TASK: [postgresql | Configure PostgreSQL - postgresql.conf] *******************
failed: [devbox] => {"failed": true}
msg: Destination directory /etc/postgresql/9.3/main does not exist
FATAL: all hosts have already failed -- aborting
To solve this problem it was necessary log in vagrant ssh and type:
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
sudo pg_createcluster 9.3 main --start
and now run provision to check again:
vagrant provision
Probably there is something missing on locale settings.
It may be related to this issue in ansible
Although they recommend to put module_lang
into [defaults]
section, it didn't help me
Also I tried this workaround for locale_gen
module, but it didn't help either
So, I had to use the solution from @cleitonpp , although it's not an ansible script
Hello, actually our time pass to same problem. Provision on mac(Yosemite) runs fine but the same provision on ubuntu (15:10) occurs the mentioned error. To solve this put this task before install postresql:
- name: "configuring locales"
shell: export LANGUAGE="en_US.UTF-8" && echo 'LANGUAGE="en_US.UTF-8"' >> /etc/default/locale && echo 'LC_ALL="en_US.UTF-8"' >> /etc/default/locale
This solve the locale problems. Now runs fine on Mac and Ubuntu!