Make the bacula director node request DB access from its role
authorPeter Palfrader <peter@palfrader.org>
Sun, 29 Sep 2019 13:27:54 +0000 (15:27 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sun, 29 Sep 2019 13:28:30 +0000 (15:28 +0200)
data/nodes/dinis.debian.org.yaml
modules/roles/manifests/bacula/director.pp [new file with mode: 0644]
modules/roles/manifests/postgresql/cluster_bacula.pp

index 0ea1f50..d6bec08 100644 (file)
@@ -1,3 +1,3 @@
 ---
 classes:
-  - bacula::director
+  - roles::bacula::director
diff --git a/modules/roles/manifests/bacula/director.pp b/modules/roles/manifests/bacula/director.pp
new file mode 100644 (file)
index 0000000..f069540
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# bacula director node
+#
+class roles::bacula::director(
+) {
+  include bacula::director
+
+  $pg_server = lookup('bacula::director::db_address')
+  $pg_port   = lookup('bacula::director::db_port')
+
+  @@postgres::cluster::hba_entry { 'bacula-sd':
+    tag      => "postgres::cluster::${pg_port}::hba::${pg_server}",
+    pg_port  => $pg_port,
+    database => 'bacula',
+    user     => ['bacula', 'bacula-dinis-reader', 'nagios'],
+    address  => $base::public_addresses,
+  }
+}
index eeebd83..12fc33b 100644 (file)
@@ -12,12 +12,4 @@ class roles::postgresql::cluster_bacula {
     pg_port    => $pg_port,
     manage_hba => true,
   }
-  postgres::cluster::hba_entry { 'bacula-dir':
-    pg_version => $pg_version,
-    pg_cluster => $pg_cluster,
-    pg_port    => $pg_port,
-    database   => 'bacula',
-    user       => ['bacula', 'bacula-dinis-reader', 'nagios'],
-    address    => ['82.195.75.77', '2001:41b8:202:deb::311:77'],
-  }
 }