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

db_username changes do not work #750

Closed
gcoxmoz opened this issue Aug 22, 2019 · 1 comment
Closed

db_username changes do not work #750

gcoxmoz opened this issue Aug 22, 2019 · 1 comment

Comments

@gcoxmoz
Copy link
Contributor

gcoxmoz commented Aug 22, 2019

I'm If I deploy foreman with the db_username parameter set to something besides the default 'foreman', the install goes sideways when the rake jobs try to connect to the DB:

Notice: /Stage[main]/Foreman::Database/Foreman_config_entry[db_pending_migration]/value: value changed '' to 'false'
Notice: /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: rake aborted!
Notice: /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: Sequel::DatabaseConnectionError: PG::ConnectionBad: FATAL:  Peer authentication failed for user "foreman_user"

Postgres' log says:

LOG:  provided user name (foreman_user) and authenticated user name (foreman) do not match
FATAL:  Peer authentication failed for user "foreman_user"

Taking out my db_username parameter or setting it to 'foreman' leads to a clean install. I'm no DBA but it looks like this is a missing postgresql::server::pg_hba_rule rule to allow for the OS username != database username.

@ekohl
Copy link
Member

ekohl commented May 11, 2020

I think that's correct for the puppetlabs-postgresql defaults, but this module doesn't manage the postgresql server rules. That's out of scope and something you need to do at a profile layer. The primary use case of the parameter is for remote databases.

@ekohl ekohl closed this as completed May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants