manage pg_hba on fasolo
authorPeter Palfrader <peter@palfrader.org>
Sun, 29 Sep 2019 16:50:17 +0000 (18:50 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sun, 29 Sep 2019 16:50:50 +0000 (18:50 +0200)
data/common.yaml
data/nodes/bmdb1.debian.org.yaml
data/nodes/fasolo.debian.org.yaml
modules/roles/manifests/postgresql/ftp_master_dak_replica.pp [new file with mode: 0644]

index b9e4589..06f3e9b 100644 (file)
@@ -51,6 +51,10 @@ bacula::client::storage_server: storace.debian.org
 roles::debsources::db_address: bmdb1.debian.org
 roles::debsources::db_port: 5440
 
+roles::postgresql::ftp_master_dak_replica::db_server: fasolo.debian.org
+roles::postgresql::ftp_master_dak_replica::db_port: 5433
+roles::postgresql::ftp_master_dak_replica::db_role: repuser
+
 
 # == other variables
 #####################
index 32e5d8c..63dac30 100644 (file)
@@ -1,6 +1,7 @@
 ---
 classes:
   - roles::postgresql::server
+  - roles::postgresql::ftp_master_dak_replica
 
 postgres::backup_server::register_backup_clienthost::allow_read_hosts: ['fasolo']
 roles::postgresql::server::manage_clusters_hba: [5440]
index 0ab2011..6f59726 100644 (file)
@@ -5,3 +5,5 @@ classes:
   - roles::postgresql::server
   - roles::static_master
   - roles::static_source
+
+roles::postgresql::server::manage_clusters_hba: true
diff --git a/modules/roles/manifests/postgresql/ftp_master_dak_replica.pp b/modules/roles/manifests/postgresql/ftp_master_dak_replica.pp
new file mode 100644 (file)
index 0000000..bcd9585
--- /dev/null
@@ -0,0 +1,20 @@
+#
+# replica of the dak instance on ftp-master
+#
+# @param db_server  address of the database server for ftp-master's dak
+# @param db_port    port of the database cluster for ftp-master's dak
+# @param db_role    replication user
+class roles::postgresql::ftp_master_dak_replica (
+  String $db_server,
+  Intger $db_port,
+  String $db_role,
+) {
+
+  @@postgres::cluster::hba_entry { 'dak-replica':
+    tag      => "postgres::cluster::${db_port}::hba::${db_server}",
+    pg_port  => $db_port,
+    database => 'replication',
+    user     => $db_role,
+    address  => $base::public_addresses,
+  }
+}