Skip to content

Commit 4dc42d2

Browse files
committed
Merge branch 'production' into feature/expanded_custom_facts
2 parents 773b037 + 2cd69bc commit 4dc42d2

12 files changed

Lines changed: 96 additions & 7 deletions

File tree

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ matrix:
2222
env: PUPPET_GEM_VERSION="~> 4.8.0" FACTER_GEM_VERSION="~> 2.4" HIERA_GEM_VERSION="~> 3.2.0"
2323
- rvm: 2.1.9
2424
env: PUPPET_GEM_VERSION="~> 4.9.0" FACTER_GEM_VERSION="~> 2.4" HIERA_GEM_VERSION="~> 3.3.0"
25+
- rvm: 2.1.9
26+
env: PUPPET_GEM_VERSION="~> 4.10.1" FACTER_GEM_VERSION="~> 2.4" HIERA_GEM_VERSION="~> 3.3.0"
2527

2628
deploy:
2729
provider: puppetforge

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ The `puppet` class is responsible for validating some of our parameters, and ins
352352

353353
Sets the runinterval in `puppet.conf`
354354

355+
* **show_diff**: (*bool* Default: `false`)
356+
357+
Whether to log and report a contextual diff when files are being replaced.
358+
355359
* **splay**: (*bool* Default `false`)
356360

357361
Sets the splay parameter in puppet.conf

manifests/config.pp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
$puppet_server = $::puppet::puppet_server
1616
$reports = $::puppet::reports
1717
$runinterval = $::puppet::runinterval
18+
$show_diff = $::puppet::show_diff
1819
$splay = $::puppet::splay
1920
$splaylimit = $::puppet::splaylimit
2021
$structured_facts = $::puppet::structured_facts
@@ -66,10 +67,19 @@
6667
$_ensure_pluginfactsource = 'absent'
6768
}
6869

70+
ini_setting { 'puppet client server agent':
71+
ensure => absent,
72+
path => "${confdir}/puppet.conf",
73+
section => 'agent',
74+
setting => 'server',
75+
value => $puppet_server,
76+
require => Class['puppet::install'],
77+
}
78+
6979
ini_setting { 'puppet client server':
7080
ensure => $_ensure_puppet_server,
7181
path => "${confdir}/puppet.conf",
72-
section => 'agent',
82+
section => 'main',
7383
setting => 'server',
7484
value => $puppet_server,
7585
require => Class['puppet::install'],
@@ -143,6 +153,15 @@
143153
require => Class['puppet::install'],
144154
}
145155

156+
ini_setting { 'puppet client show_diff':
157+
ensure => present,
158+
path => "${confdir}/puppet.conf",
159+
section => 'agent',
160+
setting => 'show_diff',
161+
value => $show_diff,
162+
require => Class['puppet::install'],
163+
}
164+
146165
ini_setting { 'puppet client splay':
147166
ensure => present,
148167
path => "${confdir}/puppet.conf",

manifests/init.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
# Whether or not to send reports
6767
# @param runinterval [String] Default: '30m'
6868
# Sets the runinterval in puppet.conf
69+
# @param show_diff [Boolean] Default: false
70+
# Sets the show_diff parameter in puppet.conf
6971
# @param splay [Boolean] Default: false
7072
# Sets the splay parameter in puppet.conf
7173
# @param splaylimit [String] Default: undef
@@ -122,6 +124,7 @@
122124
$puppet_version = 'installed',
123125
$reports = true,
124126
$runinterval = '30m',
127+
$show_diff = false,
125128
$splay = false,
126129
$splaylimit = undef,
127130
$structured_facts = false,
@@ -141,6 +144,7 @@
141144
$manage_etc_facter_facts_d,
142145
$manage_repos,
143146
$reports,
147+
$show_diff,
144148
$splay,
145149
$structured_facts,
146150
)

manifests/install.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
package { $agent_package:
2222
ensure => $package_ensure,
23-
require => Class['::puppet::install::deps']
23+
require => Class['::puppet::install::deps'],
24+
notify => Class['::puppet::agent'],
2425
}
2526

2627
}

manifests/profile/agent.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
# Whether or not to send reports
6363
# @param runinterval [String] Default: '30m'
6464
# Sets the runinterval in puppet.conf
65+
# @param show_diff [Boolean] Default: false
66+
# Sets the show_diff parameter in puppet.conf
6567
# @param splay [Boolean] Default: false
6668
# Sets the splay parameter in puppet.conf
6769
# @param splaylimit [String] Default: undef
@@ -101,6 +103,7 @@
101103
$puppet_version = 'installed',
102104
$reports = true,
103105
$runinterval = '30m',
106+
$show_diff = false,
104107
$splay = false,
105108
$splaylimit = undef,
106109
$structured_facts = false,
@@ -131,6 +134,7 @@
131134
puppet_version => $puppet_version,
132135
reports => $reports,
133136
runinterval => $runinterval,
137+
show_diff => $show_diff,
134138
splay => $splay,
135139
splaylimit => $splaylimit,
136140
structured_facts => $structured_facts,

manifests/profile/puppetdb.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
#
1111
# @param puppetdb_version [String] Default: 'installed'
1212
# The version of puppetdb to install.
13+
# @param puppetdb_manage_dbserver [Boolean] Default: true
14+
# Whether to tell PuppetDB to also manage the Postgresql server.
15+
# Set this to false if you are independently configuring a
16+
# Postgresql server, e.g., because you are using it for other
17+
# databases in addition to pupept.
1318
# @param node_purge_ttl [String] Default: 0s
1419
# The length of time a node can be deactivated before it's deleted from the database. (a value of '0' disables purging).
1520
# @param node_ttl [String] Default: '0s'
@@ -33,6 +38,7 @@
3338
$node_ttl = '0s',
3439
$puppetdb_listen_address = '127.0.0.1',
3540
$puppetdb_server = undef,
41+
$puppetdb_manage_dbserver = true,
3642
$puppetdb_ssl_listen_address = '0.0.0.0',
3743
$report_ttl = '14d',
3844
$reports = undef,
@@ -106,6 +112,7 @@
106112
disable_ssl => $disable_ssl,
107113
listen_address => $puppetdb_listen_address,
108114
ssl_listen_address => $puppetdb_ssl_listen_address,
115+
manage_dbserver => $puppetdb_manage_dbserver,
109116
node_ttl => $node_ttl,
110117
node_purge_ttl => $node_purge_ttl,
111118
report_ttl => $report_ttl,

manifests/profile/r10k.pp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# @param cachedir [String] Default: undef
99
# @param configfile [String] Default: undef
1010
# @param version [String] Default: undef
11+
# @param puppet_master [String] Default: undef
1112
# @param modulepath [String] Default: undef
1213
# @param manage_modulepath [String] Default: undef
1314
# @param manage_ruby_dependency [String] Default: 'ignore'
@@ -21,6 +22,9 @@
2122
# @param configfile_symlink [String] Default: undef
2223
# @param include_prerun_command [Boolean] Default: false
2324
# @param include_postrun_command [Boolean] Default: false
25+
# @param git_settings [String] Default: undef
26+
# @param forge_settings [String] Default: undef
27+
# @param postrun [String] Default: undef
2428
# @param env_owner [String] Default:'root',
2529
# @param r10k_minutes [Array] Default [0,15,30,45]
2630
# @param r10k_update [Boolean] true
@@ -32,6 +36,7 @@
3236
$cachedir = undef,
3337
$configfile = undef,
3438
$version = undef,
39+
$puppet_master = undef,
3540
$modulepath = undef,
3641
$manage_modulepath = undef,
3742
$manage_ruby_dependency = 'ignore',
@@ -45,6 +50,9 @@
4550
$configfile_symlink = undef,
4651
$include_prerun_command = false,
4752
$include_postrun_command = false,
53+
$git_settings = undef,
54+
$forge_settings = undef,
55+
$postrun = undef,
4856
$env_owner = 'root',
4957
$r10k_minutes = [
5058
0,
@@ -82,6 +90,7 @@
8290
cachedir => $cachedir,
8391
configfile => $configfile,
8492
version => $version,
93+
puppet_master => $puppet_master,
8594
modulepath => $modulepath,
8695
manage_modulepath => $manage_modulepath,
8796
manage_ruby_dependency => $manage_ruby_dependency,
@@ -95,6 +104,9 @@
95104
configfile_symlink => $configfile_symlink,
96105
include_prerun_command => $include_prerun_command,
97106
include_postrun_command => $include_postrun_command,
107+
git_settings => $git_settings,
108+
forge_settings => $forge_settings,
109+
postrun => $postrun,
98110
}
99111

100112
# cron for updating the r10k environment

spec/classes/puppet_config_spec.rb

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,22 @@
4444
end
4545
context 'when fed no parameters' do
4646
it "should properly set the puppet server setting in #{confdir}/puppet.conf" do
47+
should contain_ini_setting('puppet client server agent').with({
48+
'ensure'=>'absent',
49+
'path'=>"#{confdir}/puppet.conf",
50+
'section'=>'agent',
51+
'setting'=>'server',
52+
'value'=>'puppet'
53+
})
4754
should contain_ini_setting('puppet client server').with({
4855
'ensure'=>'present',
4956
'path'=>"#{confdir}/puppet.conf",
50-
'section'=>'agent',
57+
'section'=>'main',
5158
'setting'=>'server',
5259
'value'=>'puppet'
5360
})
61+
end
62+
it "should properly set the puppet srv records settings in #{confdir}/puppet.conf" do
5463
should contain_ini_setting('puppet use_srv_records').with({
5564
'ensure'=>'absent',
5665
'path'=>"#{confdir}/puppet.conf",
@@ -82,6 +91,15 @@
8291
'value'=>'30m'
8392
})
8493
end
94+
it "should set the puppet agent show_diff parameter in #{confdir}/puppet.conf" do
95+
should contain_ini_setting('puppet client show_diff').with({
96+
'ensure'=>'present',
97+
'path'=>"#{confdir}/puppet.conf",
98+
'section'=>'agent',
99+
'setting'=>'show_diff',
100+
'value'=>false
101+
})
102+
end
85103
it "should set the puppet agent splay parameter in #{confdir}/puppet.conf" do
86104
should contain_ini_setting('puppet client splay').with({
87105
'ensure'=>'present',
@@ -187,12 +205,18 @@
187205
context 'when ::puppet::puppet_server has a non-standard value' do
188206
let(:pre_condition){"class{'::puppet': puppet_server => 'BOGON'}"}
189207
it "should properly set the server setting in #{confdir}/puppet.conf" do
190-
should contain_ini_setting('puppet client server').with({
208+
should_not contain_ini_setting('puppet client server').with({
191209
'path'=>"#{confdir}/puppet.conf",
192210
'section'=>'agent',
193211
'setting'=>'server',
194212
'value'=>'BOGON'
195213
})
214+
should contain_ini_setting('puppet client server').with({
215+
'path'=>"#{confdir}/puppet.conf",
216+
'section'=>'main',
217+
'setting'=>'server',
218+
'value'=>'BOGON'
219+
})
196220
end
197221
end# custom server
198222
context 'when ::puppet::environment has a non-standard value' do
@@ -217,6 +241,17 @@
217241
})
218242
end
219243
end# custom runinterval
244+
context 'when ::puppet::show_diff is true' do
245+
let(:pre_condition) {"class{'::puppet': show_diff => true}"}
246+
it "should properly set the show_diff setting in #{confdir}/puppet.conf" do
247+
should contain_ini_setting('puppet client show_diff').with({
248+
'path'=>"#{confdir}/puppet.conf",
249+
'section'=>'agent',
250+
'setting'=>'show_diff',
251+
'value'=>true
252+
})
253+
end
254+
end# custom show_diff
220255
context 'when ::puppet::splay is true' do
221256
let(:pre_condition) {"class{'::puppet': splay => true}"}
222257
it "should properly set the splay setting in #{confdir}/puppet.conf" do
@@ -283,7 +318,7 @@
283318
should contain_ini_setting('puppet client server').with({
284319
'ensure' => 'absent',
285320
'path'=>"#{confdir}/puppet.conf",
286-
'section'=>'agent',
321+
'section'=>'main',
287322
'setting'=>'server',
288323
})
289324
end

spec/classes/puppet_install_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
it 'should install puppet' do
6464
contain_package('puppet').with({
6565
:ensure=>"BOGON",
66-
}).that_requires("Class['::puppet::install::deps]")
66+
}).that_requires("Class['::puppet::install::deps]").that_notifies('class[Puppet::Agent]')
6767
end
6868
end# allinone false
6969
end

0 commit comments

Comments
 (0)