foreman-installer does not create /usr/share/foreman/.postgresql/root.crt when --foreman-db-manage false is set how to reproduce: # foreman-installer --scenario katello --foreman-db-manage false --foreman-db-host remote-db-host.redhat.com --foreman-db-root-cert /usr/share/foreman/root.crt [ WARN 2018-03-19T10:24:21 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: ActiveRecord::NoDatabaseError: root certificate file "/usr/share/foreman/.postgresql/root.crt" does not exist # ls /usr/share/foreman/.postgresql/root.crt ls: cannot access /usr/share/foreman/.postgresql/root.crt: No such file or directory version foreman-installer-1.18.0-0.develop.201803160331giteb46741.el7.noarch
Created from redmine issue http://projects.theforeman.org/issues/22940
Upstream bug assigned to None
to make it more clear what it means if you setup SSL for foreman database # satellite-installer --scenario satellite --foreman-db-manage false --foreman-db-host remote-db-host.redhat.com --foreman-db-database foreman1db --foreman-db-username foreman1 --foreman-db-password foreman1pw --foreman-db-port 5432 --foreman-db-sslmode verify-full --foreman-db-root-cert /tmp/root.crt then db:migrate fails because foreman cannot verify the database's certificate (missing ~foreman/.postgresql/root.crt) [ERROR 2018-06-19T08:45:53 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: Failed to call refresh: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0] [ERROR 2018-06-19T08:45:53 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
Upstream bug assigned to ekohlvan
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/22940 has been resolved.
Verified with Sat 6.4 snap 20. Setup a PostgreSQL server, setup for listening on all interfaces (postgresql.conf), create a user, enable password login, create a database named as the user, generate certificates ( https://www.postgresql.org/docs/9.5/static/ssl-tcp.html ) , force SSL (hostssl in pghba.conf). Copy the generated root.crt to another machine. On that other machine, use reproducer from comment 4. The installation is successful and the Satellite instance works.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:2927