summaryrefslogtreecommitdiff
path: root/manifests/record.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/record.pp')
-rw-r--r--manifests/record.pp36
1 files changed, 36 insertions, 0 deletions
diff --git a/manifests/record.pp b/manifests/record.pp
new file mode 100644
index 0000000..dc43aaa
--- /dev/null
+++ b/manifests/record.pp
@@ -0,0 +1,36 @@
+# = Definition: bind::record
+#
+# Helper to create any record you want (but NOT MX, please refer to Bind::Mx)
+#
+# Arguments:
+# *$zone*: Bind::Zone name
+# *$owner*: owner of the Resource Record
+# *$host*: target of the Resource Record
+# *$record_type°: resource record type
+# *$record_class*: resource record class. Default "IN".
+# *$ttl*: Time to Live for the Resource Record. Optional.
+#
+define bind::record (
+ $zone,
+ $host,
+ $record_type,
+ $ensure = present,
+ $owner = false,
+ $record_class = 'IN',
+ $ttl = false
+) {
+
+ if $owner {
+ $_owner = $owner
+ } else {
+ $_owner = $name
+ }
+
+ concat::fragment {"${zone}.${record_type}.${name}":
+ ensure => $ensure,
+ target => "/etc/bind/pri/${zone}.conf",
+ content => template('bind/default-record.erb'),
+ notify => Service['bind9'],
+ }
+
+}