# @param type # Record type (A, AAAA, ...) # @param class # DNS class type (IN, HS, CH, HS) # @param dns_name # Name of record (example.com.) # Note that the trailing period **IS** significant # @param ttl # TTL for record. # @param duplicate # Allow multiple records with the same name and class. # Most record types only allow one value, but some allow multiple. # Setting this to true allows for multiple. This value is # automatically true for TXT & NS. # @param zone # Name of the zone this record belongs to. # @param value # Record content. # Syntax depends on `type`. define dns::record ( String $zone, Dns::Rr $type, String $value, Dns::Class $class = 'IN', String $dns_name = $name, Optional[Dns::Ttl] $ttl = undef, Boolean $duplicate = false, ) { $allow_duplicate = case $type { 'TXT', 'NS': { true } default: { false } } $frag_name = if $allow_duplicate { "Dns::Record - ${zone} - ${class} ${type} ${dns_name} ${value}" } else { "Dns::Record - ${zone} - ${class} ${type} ${dns_name}" } concat::fragment { $frag_name: target => "${dns::zone_directory}/${zone}.db", } }