Skip to content

Commit df02b1a

Browse files
Added external_nodes and node_terminus parameters to allow puppet::master to use an ENC
1 parent fa4cc12 commit df02b1a

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

manifests/master.pp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
# ['group_id'] - The groupid of the puppet group
88
# ['modulepath'] - Module path to be served by the puppet master
99
# ['manifest'] - Manifest path
10+
# ['external_nodes'] - ENC script path
11+
# ['node_terminus'] - Node terminus setting, is overridden to 'exec' if external_nodes is set
1012
# ['hiera_config'] - Hiera config file path
1113
# ['environments'] - Which environment method (directory or config)
1214
# ['environmentpath'] - Puppet environment base path (use with environments directory)
@@ -55,6 +57,8 @@
5557
$group_id = undef,
5658
$modulepath = $::puppet::params::modulepath,
5759
$manifest = $::puppet::params::manifest,
60+
$external_nodes = 'UNSET',
61+
$node_terminus = 'UNSET',
5862
$hiera_config = $::puppet::params::hiera_config,
5963
$environmentpath = $::puppet::params::environmentpath,
6064
$environments = $::puppet::params::environments,
@@ -225,6 +229,27 @@
225229
value => $environmentpath,
226230
}
227231

232+
if $external_nodes != 'UNSET'{
233+
ini_setting {'puppetmasterencconfig':
234+
ensure => present,
235+
setting => 'external_nodes',
236+
value => $external_nodes,
237+
}
238+
239+
ini_setting {'puppetmasternodeterminus':
240+
ensure => present,
241+
setting => 'node_terminus',
242+
value => 'exec'
243+
}
244+
}
245+
elsif $node_terminus != 'UNSET'{
246+
ini_setting {'puppetmasternodeterminus':
247+
ensure => present,
248+
setting => 'node_terminus',
249+
value => $node_terminus
250+
}
251+
}
252+
228253
ini_setting {'puppetmasterhieraconfig':
229254
ensure => present,
230255
setting => 'hiera_config',

spec/classes/puppet_master_spec.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
:puppet_master_service => 'puppetmaster',
1919
:modulepath => '/etc/puppet/modules',
2020
:manifest => '/etc/puppet/manifests/site.pp',
21+
:external_nodes => '/usr/local/bin/puppet_node_classifier',
22+
:node_terminus => 'exec',
2123
:autosign => 'true',
2224
:certname => 'test.example.com',
2325
:storeconfigs => 'true',
@@ -94,6 +96,22 @@
9496
:value => params[:manifest],
9597
:require => 'File[/etc/puppet/puppet.conf]'
9698
)
99+
should contain_ini_setting('puppetmasterencconfig').with(
100+
:ensure => 'present',
101+
:section => 'master',
102+
:setting => 'external_nodes',
103+
:path => '/etc/puppet/puppet.conf',
104+
:value => params[:external_nodes],
105+
:require => 'File[/etc/puppet/puppet.conf]'
106+
)
107+
should contain_ini_setting('puppetmasternodeterminus').with(
108+
:ensure => 'present',
109+
:section => 'master',
110+
:setting => 'node_terminus',
111+
:path => '/etc/puppet/puppet.conf',
112+
:value => params[:node_terminus],
113+
:require => 'File[/etc/puppet/puppet.conf]'
114+
)
97115
should contain_ini_setting('puppetmasterautosign').with(
98116
:ensure => 'present',
99117
:section => 'master',
@@ -163,6 +181,8 @@
163181
:puppet_master_service => 'puppetmaster',
164182
:modulepath => '/etc/puppet/modules',
165183
:manifest => '/etc/puppet/manifests/site.pp',
184+
:external_nodes => '/usr/local/bin/puppet_node_classifier',
185+
:node_terminus => 'exec',
166186
:autosign => 'true',
167187
:certname => 'test.example.com',
168188
:storeconfigs => 'true',
@@ -237,6 +257,22 @@
237257
:value => params[:manifest],
238258
:require => 'File[/etc/puppet/puppet.conf]'
239259
)
260+
should contain_ini_setting('puppetmasterencconfig').with(
261+
:ensure => 'present',
262+
:section => 'master',
263+
:setting => 'external_nodes',
264+
:path => '/etc/puppet/puppet.conf',
265+
:value => params[:external_nodes],
266+
:require => 'File[/etc/puppet/puppet.conf]'
267+
)
268+
should contain_ini_setting('puppetmasternodeterminus').with(
269+
:ensure => 'present',
270+
:section => 'master',
271+
:setting => 'node_terminus',
272+
:path => '/etc/puppet/puppet.conf',
273+
:value => params[:node_terminus],
274+
:require => 'File[/etc/puppet/puppet.conf]'
275+
)
240276
should contain_ini_setting('puppetmasterautosign').with(
241277
:ensure => 'present',
242278
:section => 'master',

0 commit comments

Comments
 (0)