feat: psql changes on master only
- add fact to detect if a psql host is a slave - only import users/db/grants on master
This commit is contained in:
@@ -88,11 +88,14 @@ class profiles::sql::patroni (
|
||||
|
||||
}
|
||||
|
||||
# collect exported resources
|
||||
$tag = "${facts['country']}-${facts['region']}-${facts['environment']}"
|
||||
Profiles::Sql::Postgres::Db <<| tag == $tag |>> {}
|
||||
Profiles::Sql::Postgres::User <<| tag == $tag |>> {}
|
||||
Profiles::Sql::Postgres::Grant <<| tag == $tag |>> {}
|
||||
# only apply changes to DBs/Users/Grants on master
|
||||
if ! $facts['psql_is_slave'] {
|
||||
# collect exported resources
|
||||
$tag = "${facts['country']}-${facts['region']}-${facts['environment']}"
|
||||
Profiles::Sql::Postgres::Db <<| tag == $tag |>> {}
|
||||
Profiles::Sql::Postgres::User <<| tag == $tag |>> {}
|
||||
Profiles::Sql::Postgres::Grant <<| tag == $tag |>> {}
|
||||
}
|
||||
|
||||
if $postgres_exporter_enabled {
|
||||
class { 'prometheus::postgres_exporter':
|
||||
|
||||
Reference in New Issue
Block a user