summaryrefslogtreecommitdiff
path: root/manifests/record.pp
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-06-10 19:13:16 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-06-10 19:13:16 +0200
commitd5981ec98b2541c27a0eea3745661a829b7613da (patch)
tree8bb485da4bea15b4a29085ce604394d0bb62ddf5 /manifests/record.pp
parentChanges to included file now notify the service. (diff)
downloaddns-d5981ec98b2541c27a0eea3745661a829b7613da.tar.gz
dns-d5981ec98b2541c27a0eea3745661a829b7613da.tar.xz
Qualify CNAMEs.
Diffstat (limited to '')
-rw-r--r--manifests/record.pp11
1 files changed, 10 insertions, 1 deletions
diff --git a/manifests/record.pp b/manifests/record.pp
index c8b0baa..d25bb85 100644
--- a/manifests/record.pp
+++ b/manifests/record.pp
@@ -33,7 +33,7 @@
define dns::record (
Dns::Zonename $zone,
Dns::Rr $type,
- String $value,
+ String[1] $value,
Dns::Class $cls = 'IN',
String $key = '@',
Optional[Dns::Ttl] $ttl = undef,
@@ -54,6 +54,15 @@ define dns::record (
'TXT': {
$value.slice(255).map |$x| { "\"${x.join()}\"" }.join(' ')
}
+ 'CNAME': {
+ # Qualify CNAMEs. This is when checking if the record already
+ # exists.
+ if $value[-1] == '.' {
+ $value
+ } else {
+ "${value}.${zone}"
+ }
+ }
default: {
$value
}