Commit 0c13c42 1 parent 9958bd3 commit 0c13c42 Copy full SHA for 0c13c42
File tree 2 files changed +24
-4
lines changed
2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 1
1
# powerdns::authoritative
2
+ #
3
+ # @param group
4
+ # Name of the group associated with the pdns authoritative service - needed to ensure the config file can be read.
2
5
class powerdns::authoritative (
6
+ String $group = ' pdns' ,
3
7
) inherits powerdns {
4
8
# install the powerdns package
5
9
package { $powerdns::authoritative_package_name :
10
14
11
15
include "powerdns::backends::${powerdns::backend}"
12
16
17
+ file { $powerdns::authoritative_config :
18
+ ensure => ' file' ,
19
+ owner => ' root' ,
20
+ group => $group ,
21
+ mode => ' 0640' ,
22
+ before => Service[' pdns' ],
23
+ }
24
+
13
25
service { 'pdns' :
14
26
ensure => running ,
15
27
name => $powerdns::authoritative_service_name ,
Original file line number Diff line number Diff line change 133
133
}
134
134
end
135
135
when '9'
136
- it { is_expected . to contain_yumrepo ( 'CRB ' ) }
136
+ it { is_expected . to contain_yumrepo ( 'crb ' ) }
137
137
if facts [ :operatingsystem ] == 'Rocky'
138
138
it {
139
139
is_expected . to contain_yumrepo ( 'crb' ) . with (
140
140
'mirrorlist' => 'http://mirrorlist.rockylinux.org/mirrorlist?arch=$basearch&repo=CRB-$releasever' ,
141
- 'descr' => 'Rocky Linux $releasever - CRB' ,
141
+ 'descr' => " #{ facts [ :operatingsystem ] } Linux $releasever - CRB" ,
142
142
)
143
143
}
144
144
else
145
145
it {
146
- is_expected . to contain_yumrepo ( 'crvb ' ) . with (
146
+ is_expected . to contain_yumrepo ( 'crb ' ) . with (
147
147
'mirrorlist' => 'http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=CRB&infra=$infra' ,
148
- 'descr' => 'CentOS Linux $releasever - CRB' ,
148
+ 'descr' => " #{ facts [ :operatingsystem ] } Linux $releasever - CRB" ,
149
149
)
150
150
}
151
151
end
178
178
it { is_expected . to contain_service ( 'pdns' ) . with ( 'enable' => 'true' ) }
179
179
it { is_expected . to contain_service ( 'pdns' ) . with ( 'name' => authoritative_service_name ) }
180
180
it { is_expected . to contain_service ( 'pdns' ) . that_requires ( "Package[#{ authoritative_package_name } ]" ) }
181
+ it 'creates the pdns.conf file' do
182
+ is_expected . to contain_file ( authoritative_config ) . with (
183
+ ensure : 'file' ,
184
+ owner : 'root' ,
185
+ group : 'pdns' ,
186
+ mode : '0640' ,
187
+ ) . that_comes_before ( 'Service[pdns]' )
188
+ end
181
189
end
182
190
183
191
context 'powerdns class with epel' do
You can’t perform that action at this time.
0 commit comments