June 2014
Intermediate to advanced
328 pages
7h 26m
English
Hiera's crusade and possibly main reason to exist is data separation. In practical terms, this means to convert Puppet code like the following one:
$dns_server = $zone ? {
'it' => '1.2.3.4',
default => '8.8.8.8',
}
class { '::resolver':
server => $dns_servers,
}Into something where there's no trace of local settings like:
$dns_server = hiera('dns_server')
class { '::resolver':
server => $dns_servers,
}With Puppet 3, the preceding code can be even more simplified with just the following line:
include ::resolver
This expects the resolver::server key evaluated as needed in our Hiera data sources.
The advantages of having data (in this case, the IP of the DNS server, whatever is the logic to elaborate it) in a separated place are ...
Read now
Unlock full access