feat: migrate pupeptdb sql to patroni (#318)

- change puppetdb::sql to using the patroni profile
- change puppetdb::api to use new patroni cluster
- remove references to puppetlabs-puppetdb managed database
- update consul rules to enable sessions

Reviewed-on: https://git.query.consul/unkinben/puppet-prod/pulls/318
This commit was merged in pull request #318.
This commit is contained in:
2025-06-19 05:52:32 +10:00
parent 26b908e5e7
commit cb1d562cb0
9 changed files with 100 additions and 53 deletions
+1 -5
View File
@@ -84,14 +84,10 @@ class profiles::sql::patroni (
],
}
$connect_settings = {
}
# only apply changes to DBs/Users/Grants on master
if ! $facts['psql_is_slave'] {
# collect exported resources
$tag = "${facts['country']}-${facts['region']}-${facts['environment']}"
$tag = "${cluster_name}-${facts['country']}-${facts['region']}-${facts['environment']}"
Profiles::Sql::Postgres::Db <<| tag == $tag |>> {}
Profiles::Sql::Postgres::User <<| tag == $tag |>> {}
Profiles::Sql::Postgres::Grant <<| tag == $tag |>> {}
+2 -1
View File
@@ -2,6 +2,7 @@ class profiles::sql::postgresdb (
String $dbname,
String $dbuser,
String $dbpass,
String $cluster_name,
Boolean $create_host_users = false,
Boolean $members_lookup = false,
String $members_role = undef,
@@ -24,7 +25,7 @@ class profiles::sql::postgresdb (
$servers_array = $servers
}
$tag = "${facts['country']}-${facts['region']}-${facts['environment']}"
$tag = "${cluster_name}-${facts['country']}-${facts['region']}-${facts['environment']}"
# only export from the first server in a cluster
if $servers_array[0] == $facts['networking']['fqdn'] {