Where is foreman database configured?

I installed Foreman few months ago over an existing Puppet/PuppetDB installation.
As of today, everything was ok but I now have to use a Postgresql database which is not related to PuppetDB or Foreman.
The problem is that Postgresql is now managed by Foreman and I can’t modify the pg_hba.conf file to accept incoming requests for this new database.
As I’m using Foreman as a facts report only GUI, how can I add a new pg_hba rule without assigning classes definitions with Foreman?
Where can I find the pg_hba configuration Foreman used to store its data?

As a side note, we don’t and don’t want to use Foreman as an ENC as every host configuration is managed along roles/profiles in our VCS.

You can configure foreman to use an external database using the --foreman-db-host … options.

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

That should prevent foreman to configure the postgres server and you should be able to make any changes to your pg_hba.

2 Likes

Ok, I’ll try this hoping it will not crush everything :smiley:

I have just noticed that there is also an option “–foreman-db-manage” to foreman-installer.

“If enabled, will install and configure the database server on this host (current: true)”

It’s not quite clear to me if you need to set this to false to use the local host as database server or if pointing to the external server would be enough…

Well I finally managed using both of the options you mentioned.

Thanks

1 Like