Skip to content
Snippets Groups Projects
Commit ef15f63c authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

dns: remove no-longer-used file cache_packages.pp

parent 6545dc02
No related branches found
Tags release/004.055
No related merge requests found
# REMOVE THIS FILE
# NOTE: This class only works with Debian.
# $cache_size_entries: the number of entries to cache.
# Default: 10000
class base::dns::cache_packages(
$cache_size_entries = 10000
){
if ($::osfamily != 'Debian') {
fail 'base::dns::cache_packages only works with Debian'
}
# We use stanford-dnscache for wheezy and dnsmasq for jessie and later.
if ($::lsbdistcodename == 'wheezy') {
# WHEEZY
# Stanford package for DNS caching.
package { 'stanford-dnscache':
ensure => present,
notify => Exec['chown dnslog:dnslog /var/log/dnscache'],
}
# This is required because ownership is wrong on reinstall of packages
# but not on initial install.
exec {'chown dnslog:dnslog /var/log/dnscache':
command => 'chown -R dnslog:dnslog /var/log/dnscache',
refreshonly => true,
}
} else {
# JESSIE and beyond
package { 'dnsmasq':
ensure => present,
}
# Call the template for /etc/dnsmasq.d/stanford-dnscache.conf. This
# template uses the $cache_size_entries class parameter.
file {'/etc/dnsmasq.d/stanford-dnscache.conf':
content => template('base/dns/etc/dnsmasq.d/stanford-dnscache.conf')
require => Package['dnsmasq'],
notify => Service['dnsmasq'],
}
# Define the service and make sure it runs. Restart the service if
# /etc/resolv.conf changes.
service { 'dnsmasq':
ensure => 'running',
require => Package['dnsmasq'],
subscribe => File['/etc/resolv.conf'],
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment