# profiles::dns::record # # Declares a DNS record for this host. Publishes it via either or both methods, # controlled by profiles::dns::updater's toggles (both on during cutover): # - nsupdate: a local concat fragment consumed by profiles::dns::updater, # which nsupdates it to the authoritative server. # - export: the legacy @@concat::fragment exported to the puppet DNS master. define profiles::dns::record ( String $record, Enum[ 'PTR', 'A', 'CNAME', 'MX', 'NS', 'SRV', 'TXT' ] $type, String $value, String $zone, Integer $order, Integer $ttl = 300, ) { include profiles::dns::updater # new: local records file consumed by the nsupdate service if $profiles::dns::updater::manage_nsupdate { # zone|name|type|ttl|value (parsed by the dns-update script) concat::fragment { "dns-record-${name}": target => $profiles::dns::updater::records_file, content => "${zone}|${record}|${type}|${ttl}|${value}\n", order => sprintf('%03d', $order), } } # legacy: export the fragment to the puppet DNS master if $profiles::dns::updater::manage_export { @@concat::fragment { "${zone}_${name}": target => "${profiles::dns::updater::master_basedir}/${zone}.conf", content => "${record} IN ${type} ${value}\n", order => $order, } } }