Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with versions on ubuntu server #18

Closed
xtrinch opened this issue Jun 12, 2017 · 3 comments
Closed

Error with versions on ubuntu server #18

xtrinch opened this issue Jun 12, 2017 · 3 comments

Comments

@xtrinch
Copy link

xtrinch commented Jun 12, 2017

TASK [geerlingguy.postgresql : Ensure PostgreSQL database is initialized.] *****
task path: /etc/ansible/roles/geerlingguy.postgresql/tasks/initialize.yml:22
<10.9.4.252> ESTABLISH SSH CONNECTION FOR USER: test
<10.9.4.252> SSH: EXEC sshpass -d14 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=22 -o User=test
 -o ConnectTimeout=10 -o ControlPath=/home/test/.ansible/cp/ansible-ssh-%h-%p-%r 10.9.4.252 '/bin/sh -c '"'"'sudo -H -S  -p "[sudo via ansible,
 key=ofxlibpjnnwlhvpuvxecdnwjthmqagiy] password: " -u postgres /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-ofxlibpjnnwlhvpuvxecdnwjthmqagiy
; LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python'"'"'"'"'"'"'"'"''"'"''
fatal: [10.9.4.252]: FAILED! => {"changed": false, "cmd": "/usr/lib/postgresql/9.5/bin/initdb -D /var/lib/postgresql/9.5/main", "failed": true,
 "invocation": {"module_args": {"_raw_params": "/usr/lib/postgresql/9.5/bin/initdb -D /var/lib/postgresql/9.5/main", "_uses_shell": false, "chd
ir": null, "creates": null, "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "msg": "[Errno 2] No such file or di
rectory", "rc": 2}

Inside /usr/lib/postgresql there is only 9.6 version.

@geerlingguy
Copy link
Owner

@xtrinch - Can you provide more details about how you got this error? Are you overriding any of this role's variables, or have you managed PostgreSQL on your server differently before, and are now adding in this role?

The tests are passing for the two latest Ubuntu LTS releases: https://travis-ci.org/geerlingguy/ansible-role-postgresql — are you running a different version?

@xtrinch
Copy link
Author

xtrinch commented Jun 14, 2017

I am running Ubuntu Server 16.04.2 LTS.

I'm not overriding any of this role's variables and it's a clean virtualbox installation of ubuntu server.
I am not entirely sure if before this I haven't tried other postgres ansible-galaxy roles, but I still think this role should not assume I come with a clean installation and at least throw me an error if it finds a different version. If I'm wrong, just close this issue :)

@geerlingguy
Copy link
Owner

I still think this role should not assume I come with a clean installation and at least throw me an error if it finds a different version.

This role (and most of my other Ansible stuff, to be honest) presumes you're either completely starting fresh (new servers/containers/etc.) and provisioning the first time, and every time thereafter, using Ansible. There are usually ways you can tweak my roles' default vars to work with existing installations, but trying to autodetect what versions/what vars/etc. is installed across multiple OSes and multiple OS versions (and accounting for repository differences, etc.) is way beyond what I'd be willing to try and support.

Basically, I would say if it's not automated, either rebuild it automated, or don't automate it and deprecate it until you can switch it off, and then bring up an automated instance in its place :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants