Project

Profile

Help

Issue #8679

Ansible install fails on RHEL 7.9 at SCL PostgreSQL 10 initialization

Added by benjamin.francois 12 days ago. Updated about 3 hours ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Category:
Installer
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
RHEL 7
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Hello,

Following the documentation at https://pulpproject.org/ansible-installer/ to install on a RHEL 7.9 Server system and now at this stage:

ansible-playbook playbooks/example-use/playbook.yml -u <managed_node_username> --ask-become-pass

This fails with the following message:

TASK [geerlingguy.postgresql : Ensure PostgreSQL database is initialized.] ***********************************************************************************************************************************************************************
fatal: [vmpulptest]: FAILED! => {"changed": true, "cmd": ["/opt/rh/rh-postgresql10/root/bin/initdb", "-D", "/var/opt/rh/rh-postgresql10/lib/pgsql/data"], "delta": "0:00:00.038178", "end": "2021-04-30 15:03:02.111454", "msg": "non-zero return code", "rc": 127, "start": "2021-04-30 15:03:02.073276", "stderr": "/opt/rh/rh-postgresql10/root/bin/initdb: error while loading shared libraries: libpq.so.rh-postgresql10-5: cannot open shared object file: No such file or directory", "stderr_lines": ["/opt/rh/rh-postgresql10/root/bin/initdb: error while loading shared libraries: libpq.so.rh-postgresql10-5: cannot open shared object file: No such file or directory"], "stdout": "", "stdout_lines": []}

Looking at the code, it looks like these vars in pulp_installer/roles/pulp_database/vars/RedHat-7.yml force using the SCL packages of PostgreSQL 10. I tried enabling the SCL before running the Ansible playbook with

source scl_source enable rh-postgresql10

and it still fails with the same error message. My best guess is that the become: forcing Ansible to sudo as user 'postgres' doesn't pass the environment variables initialized by the SCL.

Maybe a chicken-and-egg problem? I ended up using this to manually work around the issue:

[root@vmpulptest ~]# scl enable rh-postgresql10 -- sudo -u postgres bash

then

[postgres@vmpulptest ~]$ /opt/rh/rh-postgresql10/root/bin/initdb -D /var/opt/rh/rh-postgresql10/lib/pgsql/data

After this, the rest of playbooks/example-use/playbook.yml went just fine.

Thanks!

History

#1 Updated by daviddavis 8 days ago

  • Category set to Installer

#2 Updated by mdepaulo@redhat.com about 3 hours ago

  • Triaged changed from No to Yes

We should try to reproduce this, and debug it from there.

#3 Updated by fao89 about 3 hours ago

Could you please share what was the installer version?

Please register to edit this issue

Also available in: Atom PDF