feat: manage grafana pgsql db

- add pgsql backend capabilities for grafana
- create/manage pgsql database for grafana
- fix psql_is_slave fact to work on all current patroni clusters
- fix extra } in resources
- fix unless in psql grant commands
- fix add database owner
- fix disabled schema permissions, the unless didnt work
This commit is contained in:
2025-06-29 18:28:12 +10:00
parent d1e63ad18b
commit d6ccb8aafe
8 changed files with 75 additions and 50 deletions
+5 -1
View File
@@ -1,7 +1,11 @@
# frozen_string_literal: true
Facter.add(:psql_is_slave) do
confine enc_role: 'roles::infra::sql::patroni'
confine enc_role: [
'roles::infra::sql::patroni',
'roles::infra::sql::shared',
'roles::infra::puppetdb::sql'
]
setcode do
# Command to check if PostgreSQL is in recovery mode
command = 'sudo -iu postgres psql -tAc "select pg_is_in_recovery()"'