diff options
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 } |