Add actual postgresl module from puppetlabs
[mirror/dsa-puppet.git] / 3rdparty / modules / postgresql / examples / postgresql_pg_hba_rule.pp
diff --git a/3rdparty/modules/postgresql/examples/postgresql_pg_hba_rule.pp b/3rdparty/modules/postgresql/examples/postgresql_pg_hba_rule.pp
new file mode 100644 (file)
index 0000000..fbd3925
--- /dev/null
@@ -0,0 +1,18 @@
+# Basic remote access
+postgresql::pg_hba_rule{ 'allow access to db foo from 2.2.2.0/24 for user foo':
+  type        => 'host',
+  database    => 'foo',
+  user        => 'foo',
+  address     => '2.2.2.0/24',
+  auth_method => 'md5',
+}
+
+# LDAP Integration
+postgresql::pg_hba_rule{ 'allow ldap access to db foo from 10.1.1.0/24 for all':
+  type        => 'host',
+  database    => 'foo',
+  user        => 'all',
+  address     => '10.1.1.0/24',
+  auth_method => 'ldap',
+  auth_option => 'ldapserver=ldap.example.net ldapprefix="cn=" ldapsuffix=", dc=example, dc=net"',
+}