Fix up the resource ordering
- Give the service and package resources stable titles and specify actual names via resource parameters. - Make all the files (including concats) happen after the package, and notify the service
This commit is contained in:
parent
658a2cdb9b
commit
66cc6ea21d
@ -11,13 +11,22 @@ class bind (
|
|||||||
|
|
||||||
$auth_nxdomain = false
|
$auth_nxdomain = false
|
||||||
|
|
||||||
package { $::bind::params::bind_package:
|
File {
|
||||||
|
ensure => present,
|
||||||
|
owner => 'root',
|
||||||
|
group => $::bind::params::bind_group,
|
||||||
|
mode => 0644,
|
||||||
|
require => Package['bind'],
|
||||||
|
notify => Service['bind'],
|
||||||
|
}
|
||||||
|
|
||||||
|
package { 'bind':
|
||||||
|
name => $::bind::params::bind_package,
|
||||||
ensure => latest,
|
ensure => latest,
|
||||||
}
|
}
|
||||||
|
|
||||||
file { $::bind::params::bind_files:
|
file { $::bind::params::bind_files:
|
||||||
ensure => present,
|
ensure => present,
|
||||||
require => Package[$bind_package],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if $dnssec {
|
if $dnssec {
|
||||||
@ -30,44 +39,23 @@ class bind (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
service { $::bind::params::bind_service:
|
|
||||||
ensure => running,
|
|
||||||
enable => true,
|
|
||||||
hasrestart => true,
|
|
||||||
hasstatus => true,
|
|
||||||
require => Package[$::bind::params::bind_package],
|
|
||||||
}
|
|
||||||
|
|
||||||
File {
|
|
||||||
ensure => present,
|
|
||||||
owner => 'root',
|
|
||||||
group => $::bind::params::bind_group,
|
|
||||||
mode => 0644,
|
|
||||||
require => Package[$::bind::params::bind_package],
|
|
||||||
}
|
|
||||||
|
|
||||||
file { [ $confdir, "${confdir}/zones" ]:
|
file { [ $confdir, "${confdir}/zones" ]:
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
mode => 2755,
|
mode => 2755,
|
||||||
purge => true,
|
purge => true,
|
||||||
recurse => true,
|
recurse => true,
|
||||||
require => Package[$::bind::params::bind_package],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${confdir}/named.conf":
|
file { "${confdir}/named.conf":
|
||||||
content => template('bind/named.conf.erb'),
|
content => template('bind/named.conf.erb'),
|
||||||
notify => Service[$::bind::params::bind_service],
|
|
||||||
require => Package[$::bind::params::bind_package],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class { 'bind::keydir':
|
class { 'bind::keydir':
|
||||||
keydir => "${confdir}/keys",
|
keydir => "${confdir}/keys",
|
||||||
require => Package[$::bind::params::bind_package],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${confdir}/named.conf.local":
|
file { "${confdir}/named.conf.local":
|
||||||
replace => false,
|
replace => false,
|
||||||
require => Package[$::bind::params::bind_package],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
concat { [
|
concat { [
|
||||||
@ -78,8 +66,8 @@ class bind (
|
|||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => $::bind::params::bind_group,
|
group => $::bind::params::bind_group,
|
||||||
mode => '0644',
|
mode => '0644',
|
||||||
notify => Service[$::bind::params::bind_service],
|
require => Package['bind'],
|
||||||
require => Package[$::bind::params::bind_package],
|
notify => Service['bind'],
|
||||||
}
|
}
|
||||||
|
|
||||||
concat::fragment { "named-acls-header":
|
concat::fragment { "named-acls-header":
|
||||||
@ -105,4 +93,12 @@ class bind (
|
|||||||
target => "${confdir}/views.conf",
|
target => "${confdir}/views.conf",
|
||||||
content => "# This file is managed by puppet - changes will be lost\n",
|
content => "# This file is managed by puppet - changes will be lost\n",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
service { 'bind':
|
||||||
|
name => $::bind::params::bind_service,
|
||||||
|
ensure => running,
|
||||||
|
enable => true,
|
||||||
|
hasrestart => true,
|
||||||
|
hasstatus => true,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user