Postgres 10 failed to start in foreman 2.5

I have installed foreman 2.5 and Katello 4.1.
I was advised to remove the Postgresql 12 as we need to test it on postgresql 10.

I stopped the foreman,
foreman-maintain service stop

Then removed the postgresql12, with below i was able to remove postgresql12 with their dependencies and install postgresql10.

I have not been able to start postgresql10.
Any suggestions

[root@foreman ~]# yum erase rh-postgresql12-postgresql-libs-12.5-1.el7.x86_64
Loaded plugins: fastestmirror
Resolving Dependencies
→ Running transaction check
—> Package rh-postgresql12-postgresql-libs.x86_64 0:12.5-1.el7 will be erased
→ Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================
Package Arch Version Repository Size

Removing:
rh-postgresql12-postgresql-libs x86_64 12.5-1.el7 @centos-sclo-rh 968 k

Transaction Summary

Remove 1 Package

Installed size: 968 k
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : rh-postgresql12-postgresql-libs-12.5-1.el7.x86_64 1/1
Verifying : rh-postgresql12-postgresql-libs-12.5-1.el7.x86_64 1/1

Removed:
rh-postgresql12-postgresql-libs.x86_64 0:12.5-1.el7

Complete!
[root@foreman ~]# yum erase rh-postgresql12-runtime-3.4-1.el7.x86_64
Loaded plugins: fastestmirror
Resolving Dependencies
→ Running transaction check
—> Package rh-postgresql12-runtime.x86_64 0:3.4-1.el7 will be erased
→ Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================
Package Arch Version Repository Size

Removing:
rh-postgresql12-runtime x86_64 3.4-1.el7 @centos-sclo-rh 21 k

Transaction Summary

Remove 1 Package

Installed size: 21 k
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : rh-postgresql12-runtime-3.4-1.el7.x86_64 1/1
Verifying : rh-postgresql12-runtime-3.4-1.el7.x86_64 1/1

Removed:
rh-postgresql12-runtime.x86_64 0:3.4-1.el7

Complete!
[root@foreman ~]# rpm -qa|grep postg
rh-postgresql10-runtime-3.1-1.el7.x86_64
rh-postgresql10-postgresql-server-10.15-1.el7.x86_64
rh-postgresql10-postgresql-libs-10.15-1.el7.x86_64
postgresql-libs-9.2.24-7.el7_9.x86_64
foreman-postgresql-2.5.1-1.el7.noarch
rh-postgresql10-3.1-1.el7.x86_64
rh-postgresql10-postgresql-10.15-1.el7.x86_64
[root@foreman ~]# yum install rh-postgresql10-runtime
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

  • base: mirror.aarnet.edu.au
  • centos-sclo-rh: mirror.aarnet.edu.au
  • epel: mirror.aarnet.edu.au
  • extras: mirror.aarnet.edu.au
  • updates: mirror.aarnet.edu.au
    Package rh-postgresql10-runtime-3.1-1.el7.x86_64 already installed and latest version
    Nothing to do
    [root@foreman ~]# rpm -qa|grep postgresql
    rh-postgresql10-runtime-3.1-1.el7.x86_64
    rh-postgresql10-postgresql-server-10.15-1.el7.x86_64
    rh-postgresql10-postgresql-libs-10.15-1.el7.x86_64
    postgresql-libs-9.2.24-7.el7_9.x86_64
    foreman-postgresql-2.5.1-1.el7.noarch
    rh-postgresql10-3.1-1.el7.x86_64
    rh-postgresql10-postgresql-10.15-1.el7.x86_64
    [root@foreman ~]# yum install postgresql10-postgresql
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
  • base: mirror.aarnet.edu.au
  • centos-sclo-rh: mirror.aarnet.edu.au
  • epel: mirror.aarnet.edu.au
  • extras: mirror.aarnet.edu.au
  • updates: mirror.aarnet.edu.au
    No package postgresql10-postgresql available.
    Error: Nothing to do
    [root@foreman ~]# yum list |grep postgresql10
    rh-postgresql10.x86_64 3.1-1.el7 @centos-sclo-r h
    rh-postgresql10-postgresql.x86_64 10.15-1.el7 @centos-sclo-r h
    rh-postgresql10-postgresql-libs.x86_64 10.15-1.el7 @centos-sclo-r h
    rh-postgresql10-postgresql-server.x86_64 10.15-1.el7 @centos-sclo-r h
    rh-postgresql10-runtime.x86_64 3.1-1.el7 @centos-sclo-r h
    postgresql10.x86_64 10.17-1PGDG.rhel7 pgdg10
    postgresql10-contrib.x86_64 10.17-1PGDG.rhel7 pgdg10
    postgresql10-devel.x86_64 10.17-1PGDG.rhel7 pgdg10
    postgresql10-docs.x86_64 10.17-1PGDG.rhel7 pgdg10
    postgresql10-libs.x86_64 10.17-1PGDG.rhel7 pgdg10
    postgresql10-odbc.x86_64 13.00.0000-1PGDG.rhel7 pgdg10
    postgresql10-plperl.x86_64 10.17-1PGDG.rhel7 pgdg10
    postgresql10-plpython.x86_64 10.17-1PGDG.rhel7 pgdg10
    postgresql10-plpython3.x86_64 10.17-1PGDG.rhel7 pgdg10
    postgresql10-pltcl.x86_64 10.17-1PGDG.rhel7 pgdg10
    postgresql10-server.x86_64 10.17-1PGDG.rhel7 pgdg10
    postgresql10-tcl.x86_64 2.7.5-1.rhel7 pgdg10
    postgresql10-test.x86_64 10.17-1PGDG.rhel7 pgdg10
    rh-postgresql10-build.x86_64 3.1-1.el7 centos-sclo-rh
    rh-postgresql10-postgresql-contrib.x86_64 10.15-1.el7 centos-sclo-rh
    rh-postgresql10-postgresql-contrib-syspaths.x86_64
    rh-postgresql10-postgresql-devel.x86_64 10.15-1.el7 centos-sclo-rh
    rh-postgresql10-postgresql-docs.x86_64 10.15-1.el7 centos-sclo-rh
    rh-postgresql10-postgresql-plperl.x86_64 10.15-1.el7 centos-sclo-rh
    rh-postgresql10-postgresql-plpython.x86_64 10.15-1.el7 centos-sclo-rh
    rh-postgresql10-postgresql-pltcl.x86_64 10.15-1.el7 centos-sclo-rh
    rh-postgresql10-postgresql-server-syspaths.x86_64
    rh-postgresql10-postgresql-static.x86_64 10.15-1.el7 centos-sclo-rh
    rh-postgresql10-postgresql-syspaths.x86_64 10.15-1.el7 centos-sclo-rh
    rh-postgresql10-postgresql-test.x86_64 10.15-1.el7 centos-sclo-rh
    rh-postgresql10-scldevel.x86_64 3.1-1.el7 centos-sclo-rh
    rh-postgresql10-syspaths.x86_64 3.1-1.el7 centos-sclo-rh
    [root@foreman ~]# yum install rh-postgresql10-postgresql-server-syspaths.x86_64
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
  • base: mirror.aarnet.edu.au
  • centos-sclo-rh: mirror.aarnet.edu.au
  • epel: mirror.aarnet.edu.au
  • extras: mirror.aarnet.edu.au
  • updates: mirror.aarnet.edu.au
    Resolving Dependencies
    → Running transaction check
    —> Package rh-postgresql10-postgresql-server-syspaths.x86_64 0:10.15-1.el7 wil l be installed
    → Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size

Installing:
rh-postgresql10-postgresql-server-syspaths
x86_64 10.15-1.el7 centos-sclo-rh 43 k

Transaction Summary

Install 1 Package

Total download size: 43 k
Installed size: 4.9 k
Is this ok [y/d/N]: y
Downloading packages:
rh-postgresql10-postgresql-server-syspaths-10.15-1.el7.x86 | 43 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : rh-postgresql10-postgresql-server-syspaths-10.15-1.el7.x86 1/1
Verifying : rh-postgresql10-postgresql-server-syspaths-10.15-1.el7.x86 1/1

Installed:
rh-postgresql10-postgresql-server-syspaths.x86_64 0:10.15-1.el7

Complete!
[root@foreman ~]# yum list |grep postgresql10
rh-postgresql10.x86_64 3.1-1.el7 @centos-sclo-r h
rh-postgresql10-postgresql.x86_64 10.15-1.el7 @centos-sclo-r h
rh-postgresql10-postgresql-libs.x86_64 10.15-1.el7 @centos-sclo-r h
rh-postgresql10-postgresql-server.x86_64 10.15-1.el7 @centos-sclo-r h
rh-postgresql10-postgresql-server-syspaths.x86_64
rh-postgresql10-runtime.x86_64 3.1-1.el7 @centos-sclo-r h
postgresql10.x86_64 10.17-1PGDG.rhel7 pgdg10
postgresql10-contrib.x86_64 10.17-1PGDG.rhel7 pgdg10
postgresql10-devel.x86_64 10.17-1PGDG.rhel7 pgdg10
postgresql10-docs.x86_64 10.17-1PGDG.rhel7 pgdg10
postgresql10-libs.x86_64 10.17-1PGDG.rhel7 pgdg10
postgresql10-odbc.x86_64 13.00.0000-1PGDG.rhel7 pgdg10
postgresql10-plperl.x86_64 10.17-1PGDG.rhel7 pgdg10
postgresql10-plpython.x86_64 10.17-1PGDG.rhel7 pgdg10
postgresql10-plpython3.x86_64 10.17-1PGDG.rhel7 pgdg10
postgresql10-pltcl.x86_64 10.17-1PGDG.rhel7 pgdg10
postgresql10-server.x86_64 10.17-1PGDG.rhel7 pgdg10
postgresql10-tcl.x86_64 2.7.5-1.rhel7 pgdg10
postgresql10-test.x86_64 10.17-1PGDG.rhel7 pgdg10
rh-postgresql10-build.x86_64 3.1-1.el7 centos-sclo-rh
rh-postgresql10-postgresql-contrib.x86_64 10.15-1.el7 centos-sclo-rh
rh-postgresql10-postgresql-contrib-syspaths.x86_64
rh-postgresql10-postgresql-devel.x86_64 10.15-1.el7 centos-sclo-rh
rh-postgresql10-postgresql-docs.x86_64 10.15-1.el7 centos-sclo-rh
rh-postgresql10-postgresql-plperl.x86_64 10.15-1.el7 centos-sclo-rh
rh-postgresql10-postgresql-plpython.x86_64 10.15-1.el7 centos-sclo-rh
rh-postgresql10-postgresql-pltcl.x86_64 10.15-1.el7 centos-sclo-rh
rh-postgresql10-postgresql-static.x86_64 10.15-1.el7 centos-sclo-rh
rh-postgresql10-postgresql-syspaths.x86_64 10.15-1.el7 centos-sclo-rh
rh-postgresql10-postgresql-test.x86_64 10.15-1.el7 centos-sclo-rh
rh-postgresql10-scldevel.x86_64 3.1-1.el7 centos-sclo-rh
rh-postgresql10-syspaths.x86_64 3.1-1.el7 centos-sclo-rh
[root@foreman ~]# yum list rh-postgresql10-postgresql-server-syspaths.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

  • base: mirror.aarnet.edu.au
  • centos-sclo-rh: mirror.aarnet.edu.au
  • epel: epel.mirror.digitalpacific.com.au
  • extras: mirror.aarnet.edu.au
  • updates: mirror.aarnet.edu.au
    Installed Packages
    rh-postgresql10-postgresql-server-syspaths.x86_64 10.15-1.el7 @centos-sclo-rh
    [root@foreman ~]# yum install rh-postgresql10-syspaths.x86_64
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
  • base: mirror.aarnet.edu.au
  • centos-sclo-rh: mirror.aarnet.edu.au
  • epel: mirror.aarnet.edu.au
  • extras: mirror.aarnet.edu.au
  • updates: mirror.aarnet.edu.au
    Resolving Dependencies
    → Running transaction check
    —> Package rh-postgresql10-syspaths.x86_64 0:3.1-1.el7 will be installed
    → Processing Dependency: rh-postgresql10-postgresql-syspaths for package: rh-p ostgresql10-syspaths-3.1-1.el7.x86_64
    → Processing Dependency: rh-postgresql10-postgresql-contrib-syspaths for packa ge: rh-postgresql10-syspaths-3.1-1.el7.x86_64
    → Running transaction check
    —> Package rh-postgresql10-postgresql-contrib-syspaths.x86_64 0:10.15-1.el7 wi ll be installed
    → Processing Dependency: rh-postgresql10-postgresql-contrib = 10.15-1.el7 for package: rh-postgresql10-postgresql-contrib-syspaths-10.15-1.el7.x86_64
    —> Package rh-postgresql10-postgresql-syspaths.x86_64 0:10.15-1.el7 will be in stalled
    → Running transaction check
    —> Package rh-postgresql10-postgresql-contrib.x86_64 0:10.15-1.el7 will be ins talled
    → Processing Dependency: libossp-uuid.so.16()(64bit) for package: rh-postgresq l10-postgresql-contrib-10.15-1.el7.x86_64
    → Running transaction check
    —> Package uuid.x86_64 0:1.6.2-26.el7 will be installed
    → Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size

Installing:
rh-postgresql10-syspaths x86_64 3.1-1.el7 centos-sclo-rh 7.5 k
Installing for dependencies:
rh-postgresql10-postgresql-contrib x86_64 10.15-1.el7 centos-sclo-rh 775 k
rh-postgresql10-postgresql-contrib-syspaths
x86_64 10.15-1.el7 centos-sclo-rh 41 k
rh-postgresql10-postgresql-syspaths x86_64 10.15-1.el7 centos-sclo-rh 43 k
uuid x86_64 1.6.2-26.el7 base 55 k

Transaction Summary

Install 1 Package (+4 Dependent packages)

Total download size: 922 k
Installed size: 2.6 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): rh-postgresql10-syspaths-3.1-1.el7.x86_64.rpm | 7.5 kB 00:00
(2/5): rh-postgresql10-postgresql-contrib-syspaths-10.15-1 | 41 kB 00:00
(3/5): uuid-1.6.2-26.el7.x86_64.rpm | 55 kB 00:00
(4/5): rh-postgresql10-postgresql-syspaths-10.15-1.el7.x86 | 43 kB 00:00
(5/5): rh-postgresql10-postgresql-contrib-10.15-1.el7.x86_ | 775 kB 00:00

Total 1.0 MB/s | 922 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : uuid-1.6.2-26.el7.x86_64 1/5
Installing : rh-postgresql10-postgresql-contrib-10.15-1.el7.x86_64 2/5
Installing : rh-postgresql10-postgresql-contrib-syspaths-10.15-1.el7.x8 3/5
Installing : rh-postgresql10-postgresql-syspaths-10.15-1.el7.x86_64 4/5
Installing : rh-postgresql10-syspaths-3.1-1.el7.x86_64 5/5
Verifying : rh-postgresql10-postgresql-syspaths-10.15-1.el7.x86_64 1/5
Verifying : rh-postgresql10-postgresql-contrib-10.15-1.el7.x86_64 2/5
Verifying : rh-postgresql10-syspaths-3.1-1.el7.x86_64 3/5
Verifying : rh-postgresql10-postgresql-contrib-syspaths-10.15-1.el7.x8 4/5
Verifying : uuid-1.6.2-26.el7.x86_64 5/5

Installed:
rh-postgresql10-syspaths.x86_64 0:3.1-1.el7

Dependency Installed:
rh-postgresql10-postgresql-contrib.x86_64 0:10.15-1.el7
rh-postgresql10-postgresql-contrib-syspaths.x86_64 0:10.15-1.el7
rh-postgresql10-postgresql-syspaths.x86_64 0:10.15-1.el7
uuid.x86_64 0:1.6.2-26.el7

Complete!
[root@foreman ~]# yum list|grep rh-postgresql10-runtime
rh-postgresql10-runtime.x86_64 3.1-1.el7 @centos-sclo-r h
[root@foreman ~]# rpm -qa|grep postgresql10
rh-postgresql10-runtime-3.1-1.el7.x86_64
rh-postgresql10-postgresql-contrib-syspaths-10.15-1.el7.x86_64
rh-postgresql10-postgresql-server-10.15-1.el7.x86_64
rh-postgresql10-postgresql-libs-10.15-1.el7.x86_64
rh-postgresql10-postgresql-server-syspaths-10.15-1.el7.x86_64
rh-postgresql10-postgresql-syspaths-10.15-1.el7.x86_64
rh-postgresql10-3.1-1.el7.x86_64
rh-postgresql10-postgresql-contrib-10.15-1.el7.x86_64
rh-postgresql10-postgresql-10.15-1.el7.x86_64
rh-postgresql10-syspaths-3.1-1.el7.x86_64
[root@foreman ~]# rpm -qa|grep foreman-postgresql
foreman-postgresql-2.5.1-1.el7.noarch
[root@foreman ~]# rpm -qa|grep postgre
rh-postgresql10-runtime-3.1-1.el7.x86_64
rh-postgresql10-postgresql-contrib-syspaths-10.15-1.el7.x86_64
rh-postgresql10-postgresql-server-10.15-1.el7.x86_64
rh-postgresql10-postgresql-libs-10.15-1.el7.x86_64
postgresql-libs-9.2.24-7.el7_9.x86_64
rh-postgresql10-postgresql-server-syspaths-10.15-1.el7.x86_64
rh-postgresql10-postgresql-syspaths-10.15-1.el7.x86_64
foreman-postgresql-2.5.1-1.el7.noarch
rh-postgresql10-3.1-1.el7.x86_64
rh-postgresql10-postgresql-contrib-10.15-1.el7.x86_64
rh-postgresql10-postgresql-10.15-1.el7.x86_64
rh-postgresql10-syspaths-3.1-1.el7.x86_64
[root@foreman ~]# systemctl status|grep postgresql
│ │ └─6130 grep --color=auto postgresql
[root@foreman ~]# systemctl status|grep -i sql
│ │ └─6147 grep --color=auto -i sql
[root@foreman ~]# systemctl status rh-postgresql10-postgresql.service
● rh-postgresql10-postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/rh-postgresql10-postgresql.service; d isabled; vendor preset: disabled)
Active: inactive (dead)
[root@foreman ~]# systemctl re-load rh-postgresql10-postgresql.service
Unknown operation ‘re-load’.
[root@foreman ~]# systemctl start rh-postgresql10-postgresql.service
Job for rh-postgresql10-postgresql.service failed because the control process ex ited with error code. See “systemctl status rh-postgresql10-postgresql.service” and “journalctl -xe” for details.
[root@foreman ~]# systemctl status rh-postgresql10-postgresql.service
● rh-postgresql10-postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/rh-postgresql10-postgresql.service; d isabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2021-07-02 14:34:04 AEST; 11s ag o
Process: 6326 ExecStartPre=/opt/rh/rh-postgresql10/root/usr/libexec/postgresql -check-db-dir %N (code=exited, status=1/FAILURE)

Jul 02 14:34:04 foreman.localdomain systemd[1]: Starting PostgreSQL database…
Jul 02 14:34:04 foreman.localdomain systemd[1]: rh-postgresql10-postgresql.s…1
Jul 02 14:34:04 foreman.localdomain systemd[1]: Failed to start PostgreSQL d…
Jul 02 14:34:04 foreman.localdomain systemd[1]: Unit rh-postgresql10-postgre…
Jul 02 14:34:04 foreman.localdomain systemd[1]: rh-postgresql10-postgresql.s…
Hint: Some lines were ellipsized, use -l to show in full.
[root@foreman ~]# systemctl status -l rh-postgresql10-postgresql.service
● rh-postgresql10-postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/rh-postgresql10-postgresql.service; d isabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2021-07-02 14:34:04 AEST; 1min 5 3s ago
Process: 6326 ExecStartPre=/opt/rh/rh-postgresql10/root/usr/libexec/postgresql -check-db-dir %N (code=exited, status=1/FAILURE)

Jul 02 14:34:04 foreman.localdomain systemd[1]: Starting PostgreSQL database ser ver…
Jul 02 14:34:04 foreman.localdomain systemd[1]: rh-postgresql10-postgresql.servi ce: control process exited, code=exited status=1
Jul 02 14:34:04 foreman.localdomain systemd[1]: Failed to start PostgreSQL datab ase server.
Jul 02 14:34:04 foreman.localdomain systemd[1]: Unit rh-postgresql10-postgresql. service entered failed state.
Jul 02 14:34:04 foreman.localdomain systemd[1]: rh-postgresql10-postgresql.servi ce failed.
[root@foreman ~]# systemctl status -l rh-postgresql10-postgresql.service
● rh-postgresql10-postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/rh-postgresql10-postgresql.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2021-07-02 14:34:04 AEST; 2min 2s ago
Process: 6326 ExecStartPre=/opt/rh/rh-postgresql10/root/usr/libexec/postgresql-check-db-dir %N (code=exited, status=1/FAILURE)

Jul 02 14:34:04 foreman.localdomain systemd[1]: Starting PostgreSQL database server…
Jul 02 14:34:04 foreman.localdomain systemd[1]: rh-postgresql10-postgresql.service: control process exited, code=exited status=1
Jul 02 14:34:04 foreman.localdomain systemd[1]: Failed to start PostgreSQL database server.
Jul 02 14:34:04 foreman.localdomain systemd[1]: Unit rh-postgresql10-postgresql.service entered failed state.
Jul 02 14:34:04 foreman.localdomain systemd[1]: rh-postgresql10-postgresql.service failed.
[root@foreman ~]# history
1 history
2 ifconfig
3 netstat -rn
4 yum update
5 foreman-installer -i
6 foreman-installer
7 ifconfig
8 puppet -t
9 puppet test -t
10 ifconfig
11 ifdown enp0s3;ifup enp0s3
12 ifconfig
13 vi /etc/hosts
14 yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
15 yum install postgresql10-server
16 rpm -qa|grep postgres
17 foreman-maintain service status --only postgresql
18 foreman-maintain service list
19 yum list|grep postgresql
20 rpm -qa|grep postgresql
21 foreman-maintain service status --only postgresql
22 rpm -qa|grep postgre
23 systemctl status rh-postgres
24 systemctl status|grep postg
25 systemctl status|grep postgres
26 systemctl status postgres
27 systemctl status rh-postgresql12-postgresql.service
28 systemctl stop rh-postgresql12-postgresql.service
29 systemctl status rh-postgresql12-postgresql.service
30 systemctl start rh-postgresql12-postgresql.service
31 systemctl rh-postgresql12-postgresql.service
32 foreman-maintain service stop
33 yum
34 yum remove rh-postgresql12-postgresql
35 yum install rh-postgresql10
36 grep centos-sclo-rh /etc/yum.repos.d/*
37 ls -altr /etc/yum.repos.d
38 foreman-maintain service start
39 foreman-maintain service status --only postgresql
40 foreman-maintain service status
41 reboot
42 id
43 whereis foreman-installer
44 rpm -qa|grep -i postg
45 systemctl status postgres
46 systemctl status|grep post
47 hammer ping
48 hammer pingclear
49 clear
50 cd /var/log
51 ls
52 cd foreman-installer/
53 ls
54 ls -altr
55 clear
56 ls
57 ls -altr
58 more katello.log
59 vi katello.log
60 grep yaml katello.log
61 clear
62 grep yaml katello.log
63 cler
64 clear
65 curl -v ‘Index of /releases/2.5/el7/x86_64
66 curl -v ‘https://yum.theforeman.org/releases/2.5/el7/x86_64/’|grep issuer
67 curl -v ‘Index of /releases/2.5/el7/x86_64’ > info
68 vi info
69 openssl s_clinet -connect yum.theforeman.org:443
70 curl -v ‘Index of /releases/2.5/el7/x86_64
71 curl -v ‘Index of /releases/2.5/el7/x86_64’ |more
72
73 history
74 pwd
75 ls
76 find / -name yaml
77 find / -name yml
78 more /opt/puppetlabs/server/data/puppetserver/yaml
79 ls /opt/puppetlabs/server/data/puppetserver/yaml
80 cd /opt/puppetlabs/server/data/puppetserver/yaml
81 ls
82 cd foreman/
83 ls
84 ls -al
85 more foreman.localdomain.yaml
86 history
87 find / -name foreman-installer
88 grep -i postgresql /usr/share/foreman-installer
89 grep -ir postgresql /usr/share/foreman-installer
90 grep -ir postgresql /usr/share/foreman-installer|more
91 pwd
92 cd /usr/share/foreman-installer/modules
93 ls
94 cd foreman
95 ls
96 cd manifests/
97 ls
98 more init.pp
99 ls
100 pwd
101 cd …
102 ls
103 cd postgresql/
104 ls
105 cd manifests/
106 ls
107 find . -name init.pp
108 ls -altr
109 more validate_db_connection.pp
110 hammer
111 cd /var/opt
112 cd rh
113 ls
114 cd rh-postgresql12/
115 ls
116 cd lib
117 ls
118 cd pgsql/
119 ls
120 cd data
121 ls
122 file postgresql.conf
123 more postgresql.conf
124 yum list pqsql
125 hammer ping
126 history
127 clear
128 foreman-maintain service list
129 foreman-maintain service status
130 foreman-maintain service status --only postgresql
131 systemctl status |grep postgresql
132 rpm -qa|grep postg
133 yum erase rh-postgresql12-postgresql-libs-12.5-1.el7.x86_64
134 yum erase rh-postgresql12-runtime-3.4-1.el7.x86_64
135 rpm -qa|grep postg
136 yum install rh-postgresql10-runtime
137 rpm -qa|grep postgresql
138 yum install postgresql10-postgresql
139 yum list |grep postgresql10
140 yum install rh-postgresql10-postgresql-server-syspaths.x86_64
141 yum list |grep postgresql10
142 yum list rh-postgresql10-postgresql-server-syspaths.x86_64
143 yum install rh-postgresql10-syspaths.x86_64
144 yum list|grep rh-postgresql10-runtime
145 rpm -qa|grep postgresql10
146 rpm -qa|grep foreman-postgresql
147 rpm -qa|grep postgre
148 systemctl status|grep postgresql
149 systemctl status|grep -i sql
150 systemctl status rh-postgresql10-postgresql.service
151 systemctl re-load rh-postgresql10-postgresql.service
152 systemctl start rh-postgresql10-postgresql.service
153 systemctl status rh-postgresql10-postgresql.service
154 systemctl status -l rh-postgresql10-postgresql.service
155 history
[root@foreman ~]# rpm -qa|grep postgre
rh-postgresql10-runtime-3.1-1.el7.x86_64
rh-postgresql10-postgresql-contrib-syspaths-10.15-1.el7.x86_64
rh-postgresql10-postgresql-server-10.15-1.el7.x86_64
rh-postgresql10-postgresql-libs-10.15-1.el7.x86_64
postgresql-libs-9.2.24-7.el7_9.x86_64
rh-postgresql10-postgresql-server-syspaths-10.15-1.el7.x86_64
rh-postgresql10-postgresql-syspaths-10.15-1.el7.x86_64
foreman-postgresql-2.5.1-1.el7.noarch
rh-postgresql10-3.1-1.el7.x86_64
rh-postgresql10-postgresql-contrib-10.15-1.el7.x86_64
rh-postgresql10-postgresql-10.15-1.el7.x86_64
rh-postgresql10-syspaths-3.1-1.el7.x86_64
[root@foreman ~]# history|grep ýum erase’

^C
[root@foreman ~]# history|grep ‘ýum erase’
157 history|grep ýum erase’
158 history|grep ‘ýum erase’
[root@foreman ~]#
[root@foreman ~]# history|grep yum
4 yum update
14 yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
15 yum install postgresql10-server
19 yum list|grep postgresql
33 yum
34 yum remove rh-postgresql12-postgresql
35 yum install rh-postgresql10
36 grep centos-sclo-rh /etc/yum.repos.d/*
37 ls -altr /etc/yum.repos.d
65 curl -v ‘Index of /releases/2.5/el7/x86_64
66 curl -v 'https://yum.theforeman.org/releases/2.5/el7/x86_64/’|grep issuer
67 curl -v ‘Index of /releases/2.5/el7/x86_64’ > info
69 openssl s_clinet -connect yum.theforeman.org:443
70 curl -v ‘Index of /releases/2.5/el7/x86_64
71 curl -v ‘Index of /releases/2.5/el7/x86_64’ |more
124 yum list pqsql
133 yum erase rh-postgresql12-postgresql-libs-12.5-1.el7.x86_64
134 yum erase rh-postgresql12-runtime-3.4-1.el7.x86_64
136 yum install rh-postgresql10-runtime
138 yum install postgresql10-postgresql
139 yum list |grep postgresql10
140 yum install rh-postgresql10-postgresql-server-syspaths.x86_64
141 yum list |grep postgresql10
142 yum list rh-postgresql10-postgresql-server-syspaths.x86_64
143 yum install rh-postgresql10-syspaths.x86_64
144 yum list|grep rh-postgresql10-runtime
159 history|grep yum

yum erase rh-postgresql12-postgresql-libs-12.5-1.el7.x86_64
yum erase rh-postgresql12-runtime-3.4-1.el7.x86_64

rh-postgresql10-runtime-3.1-1.el7.x86_64
rh-postgresql10-postgresql-contrib-syspaths-10.15-1.el7.x86_64
rh-postgresql10-postgresql-server-10.15-1.el7.x86_64
rh-postgresql10-postgresql-libs-10.15-1.el7.x86_64
postgresql-libs-9.2.24-7.el7_9.x86_64
rh-postgresql10-postgresql-server-syspaths-10.15-1.el7.x86_64
rh-postgresql10-postgresql-syspaths-10.15-1.el7.x86_64
foreman-postgresql-2.5.1-1.el7.noarch
rh-postgresql10-3.1-1.el7.x86_64
rh-postgresql10-postgresql-contrib-10.15-1.el7.x86_64
rh-postgresql10-postgresql-10.15-1.el7.x86_64
rh-postgresql10-syspaths-3.1-1.el7.x86_64

[root@foreman ~]# systemctl status -l rh-postgresql10-postgresql.service
● rh-postgresql10-postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/rh-postgresql10-postgresql.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2021-07-02 14:34:04 AEST; 2min 2s ago
Process: 6326 ExecStartPre=/opt/rh/rh-postgresql10/root/usr/libexec/postgresql-check-db-dir %N (code=exited, status=1/FAILURE)

Jul 02 14:34:04 foreman.localdomain systemd[1]: Starting PostgreSQL database server…
Jul 02 14:34:04 foreman.localdomain systemd[1]: rh-postgresql10-postgresql.service: control process exited, code=exited status=1
Jul 02 14:34:04 foreman.localdomain systemd[1]: Failed to start PostgreSQL database server.
Jul 02 14:34:04 foreman.localdomain systemd[1]: Unit rh-postgresql10-postgresql.service entered failed state.
Jul 02 14:34:04 foreman.localdomain systemd[1]: rh-postgresql10-postgresql.service failed.

Why would you do that? What’s the problem with postgresql 12?

Did you install postgresql-12 as part of the katello installation, i.e. the foreman-installer installed it? Then you should change. It’s under control of foreman/katello. As multiple postgresql versions can be installed in parallel, each version has it’s own configuration directory and thus it won’t work to remove the 12 rpms and install the 10 rpms.

If you have installed it as external database then it may be possible to use a old version although docs say the foreman supports postgresql 12.1.

https://docs.theforeman.org/2.5/Installing_Server_on_Red_Hat/index-katello.html#using-external-databases_foreman

Foreman supports PostgreSQL version 12.1.

thanks gvde

I was advised earlier that foreman 2.5/katello 4.1 supports postgres10 but it is advised to use postgres12.
I did the install as per normal using the guide to installing foreman 2.5/katello 4.1.
The reason we wanted to go to postgres10 was that our developers don’t support postgres12

Below was the packages installed at the time of the foreman install.
[root@foreman ~]# rpm -qa|grep postgre
rh-postgresql12-postgresql-libs-12.5-1.el7.x86_64
rh-postgresql12-postgresql-syspaths-12.5-1.el7.x86_64
rh-postgresql12-postgresql-server-12.5-1.el7.x86_64
rh-postgresql12-postgresql-12.5-1.el7.x86_64
postgresql-libs-9.2.24-7.el7_9.x86_64
foreman-postgresql-2.5.1-1.el7.noarch
rh-postgresql12-postgresql-evr-0.0.2-1.el7.x86_64
rh-postgresql12-runtime-3.4-1.el7.x86_64
rh-postgresql12-postgresql-server-syspaths-12.5-1.el7.x86_64

compare to i installed after removing postgres12.
Leaving foreman-postgresql-2.5.1-1.el7.noarch

[root@foreman ~]# rpm -qa|grep postgres
rh-postgresql10-runtime-3.1-1.el7.x86_64
rh-postgresql10-postgresql-contrib-syspaths-10.15-1.el7.x86_64
rh-postgresql10-postgresql-server-10.15-1.el7.x86_64
rh-postgresql10-3.1-1.el7.x86_64
rh-postgresql10-postgresql-libs-10.15-1.el7.x86_64
postgresql-libs-9.2.24-7.el7_9.x86_64
rh-postgresql10-postgresql-server-syspaths-10.15-1.el7.x86_64
rh-postgresql10-postgresql-syspaths-10.15-1.el7.x86_64
foreman-postgresql-2.5.1-1.el7.noarch
rh-postgresql10-postgresql-contrib-10.15-1.el7.x86_64
rh-postgresql10-postgresql-10.15-1.el7.x86_64

If i install Postgres10 in parallel with the installed version Postgres12 then what is the process of letting the foreman know the change of the version?

The postgres database you have installed with the foreman-installer is part of foreman/katello. I wouldn’t use it for anything else. It doesn’t bother your developers at all. They are not supposed to use that database. It’s managed by foreman. In a future version, the foreman installer may automatically upgrade the postgresql version to 13.

If you don’t want that, then you have to install foreman/katello with an external database. Instructions are in the docs. Then you manage the database and all database updates yourself. Of course, even then your developers must be careful with any changes to that database as any change could break it for foreman…

Thus, either you fix your broken installation and restore the postgresql as it was and keep the database as part of foreman or reinstall the whole server (from a new os installation) with external database.

Your developers generally should not have any business on the foreman/katello server…

1 Like

In addition to what @gvde said (which I all agree with), it should be noted that we currently rely on the evr extension. We build an RPM for it using rh-postgresql12 but if you choose to use another version you are responsible for making it work.

I also think PostgreSQL has excellent backwards compatibility so I’m not sure why you would want an older version. Unless you have some real edge case, but if you’re that advanced then you also know how to install a separate database server for that.

1 Like