diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-06-10 19:13:16 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-06-10 19:13:16 +0200 |
commit | d5981ec98b2541c27a0eea3745661a829b7613da (patch) | |
tree | 8bb485da4bea15b4a29085ce604394d0bb62ddf5 /manifests/record.pp | |
parent | Changes to included file now notify the service. (diff) | |
download | dns-d5981ec98b2541c27a0eea3745661a829b7613da.tar.gz dns-d5981ec98b2541c27a0eea3745661a829b7613da.tar.xz |
Qualify CNAMEs.
Diffstat (limited to 'manifests/record.pp')
-rw-r--r-- | manifests/record.pp | 11 |
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 } |