class dnsmasq { package { "dnsmasq": ensure => installed, } } define dnsmasq::config ( $dhcp_authoritative = 'absent', $dhcp_range = 'absent', $dhcp_gw = 'absent', $dhcp_nameservers = 'absent', $dhcp_script = 'absent', $dhcp_hostsfile = 'absent', $addn_hosts = 'absent', $domain = 'absent', $dhcp_boot = 'absent', $tftp_root = 'absent', $log_queries = 'absent', $log_dhcp = 'absent' ) { include dnsmasq file { "/etc/dnsmasq.d/my.dnsmasq.conf": content => template("dnsmasq/my.dnsmasq.conf.erb"), owner => root, group => root, mode => 644, require => Package["dnsmasq"], notify => Service["dnsmasq"]; "/etc/dnsmasq.hostsfile": ensure => present, owner => root, group => root, mode => 644, require => Package["dnsmasq"]; "/usr/local/sbin/dnsmasq-genhostname.sh": source => "puppet://$servername/dnsmasq/dnsmasq-genhostname.sh", owner => root, group => root, mode => 755, require => File["/etc/dnsmasq.hostsfile"]; "/etc/hosts.dnsmasq": ensure => present, owner => root, group => root, mode => 644, require => Package["dnsmasq"]; } service { "dnsmasq": ensure => running, hasrestart => true, hasstatus => true, require => File["/etc/dnsmasq.d/my.dnsmasq.conf"], } }