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

[ansible/postgres] failed to find PGDATA setting in -D.service #36

Closed
miki-sinmandella opened this issue Aug 24, 2020 · 8 comments · Fixed by #106
Closed

[ansible/postgres] failed to find PGDATA setting in -D.service #36

miki-sinmandella opened this issue Aug 24, 2020 · 8 comments · Fixed by #106
Assignees

Comments

@miki-sinmandella
Copy link

hi,
I am trying to deploy artifactory with ansible.
when I deployed Postgres I receive the error "failed to find PGDATA setting in -D.service".

@jefferyfry
Copy link
Contributor

Are you running SELinux?

@wdrury-uk
Copy link

wdrury-uk commented Nov 9, 2020

Im also getting this error on virtualbox lab - RHEL 7.8 VMs.

Also see related issue #58 I manually fixed by adding the missing variable to the postgres role/vars/Rehat.yml but now it progress to the below error returned form the task.

TASK [jfrog.installers.postgres : initialize PostgreSQL database cluster] ****************************************************
task path: /root/.ansible/collections/ansible_collections/jfrog/installers/roles/postgres/tasks/main.yml:33
fatal: [postgres]: FAILED! => changed=true
  cmd:
  - /usr/pgsql-9.6/bin/postgresql96-setup
  - initdb
  - -D
  - /var/lib/pgsql/9.6/data
  delta: '0:00:00.035386'
  end: '2020-11-09 21:44:45.547958'
  msg: non-zero return code
  rc: 1
  start: '2020-11-09 21:44:45.512572'
  stderr: 'systemctl: invalid option -- ''D'''
  stderr_lines: <omitted>
  stdout: failed to find PGDATA setting in -D.service
  stdout_lines: <omitted>

@peters95
Copy link
Contributor

peters95 commented Nov 9, 2020

@wdrury-uk Creating an internal bug ticket for the ansible team to dig into. Will notify you of any update.

@chukka
Copy link
Collaborator

chukka commented Nov 10, 2020

Thanks @miki-sinmandella @wdrury-uk for reporting , we currently support ubuntu only, we are planning to support RHEL, Centos 7.x /8.x in upcoming weeks (mostly next month)

@chukka chukka added bug Something isn't working Ansible labels Nov 10, 2020
@chukka chukka changed the title failed to find PGDATA setting in -D.service [ansible/postgres] failed to find PGDATA setting in -D.service Nov 10, 2020
@chukka
Copy link
Collaborator

chukka commented Nov 11, 2020

@wdrury-uk Workaround till we release official fix :

After the error initialise the DB manually with below command and run the playbook again

# /usr/pgsql-9.6/bin/postgresql96-setup initdb postgresql-9.6 -D /var/lib/pgsql/9.6/data

@wdrury-uk
Copy link

Thanks for the fix @chukka will try this morning.

@peters95 just to confirm you mention this collection only supports unbuntu yet the postgres role is code to support only Debian and RedHat (RHEL)? Did you mean those two OS?

Also can the ReadMe for the collection on Galaxy be extended to have section at top for Supported OS/Postgres Versions?

@wdrury-uk
Copy link

wdrury-uk commented Nov 11, 2020

@chukka I can confirm the above fix, workaround being executed on the postgres db servers after first play execution failure with this issue error does solve the issue.

Fix Steps

  1. Execute the play until errors
  2. Logon each postgres db node and execute
    [$] /usr/pgsql-9.6/bin/postgresql96-setup initdb postgresql-9.6 -D /var/lib/pgsql/9.6/data
  3. Re-execute play and postgres install completes with Success

@chukka
Copy link
Collaborator

chukka commented Nov 11, 2020

Great ! lets wait for the fix in the upcoming release :)

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

Successfully merging a pull request may close this issue.

5 participants