puppetlabs / puppet-docs

Curated Puppet Documentation
Other
221 stars 303 forks source link

PuppetDB: Postgresql database, 'puppetdb' doesn't yet exist when issuing psql command #1148

Open bschonec opened 7 months ago

bschonec commented 7 months ago

In PuppetDB setup for Postgresql, the database, 'puppetdb' doesn't yet exist when issuing the command:

psql puppetdb -c 'grant puppetdb_read to puppetdb'

The createdb command should precede the psql command:

sudo -u postgres sh
createuser -DRSP puppetdb
createuser -DRSP puppetdb_read
# For coordinating partition cleanup
psql puppetdb -c 'grant puppetdb_read to puppetdb'

createdb -E UTF8 -O postgres puppetdb
psql puppetdb -c 'revoke create on schema public from public'
psql puppetdb -c 'grant create on schema public to puppetdb'
psql puppetdb -c 'alter default privileges for user puppetdb in schema public grant select on tables to puppetdb_read'
psql puppetdb -c 'alter default privileges for user puppetdb in schema public grant usage on sequences to puppetdb_read'
psql puppetdb -c 'alter default privileges for user puppetdb in schema public grant execute on functions to puppetdb_read'
lisarobertson commented 6 months ago

This request need some investigation.

github-actions[bot] commented 6 months ago

Migrated issue to PUPDOC-5632