beaker-answers 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTAxMjYyZjQ3ZTFkODFiMWU1OTAzOTRjZDVhZGEwZmRmOGRiZTVkZg==
4
+ NDg1YmEwYTYzYTUxOTA5NmM3YjljYzdjMzA0ZTdiZGVmYjU3Yzc1Yw==
5
5
  data.tar.gz: !binary |-
6
- ZGMzOWQ0YWRmY2EzNmZhY2E5OTQ1NDdhYzZiNTJhYmU5NTFiYWMzYw==
6
+ YjA4Mjk5MDRlMDNmZDNiNDJlNDQwZmQ1NDY3NTA2MjE4MTk3ZTY0NA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGM0MmZkMjdhNDE5NjFjN2QwYmUyNzBmNDgwNWMzYjg5OWU5NWJlNDk2YzIx
10
- YTczYWZjZjc5NzljMWZjOWE3YjY5NTI2MWI2ODc5ZmI3Y2VhN2E5OGIzYWY1
11
- MmY1MjJiNGMxMjQyZDc4YmRkMDQ0ZjVmYmIyZDZiZWQ4ZDA3YzE=
9
+ NGQ2Zjc3OWYzZTNiOWUwMDRjM2Y4NGNlNGY3ZmI3MjNiODJlYWE5ZDBiZDdm
10
+ MmJiM2MxZmRjYmYwNTM0MTU1Nzk0YmVkYTBkMzA1YWVlNjlhNDQ4MmIwY2Yw
11
+ ZmI4MzQzNDgxMTY4NDMxY2Q4MzQzODgxZDk4NzEyOGE1MzZjMzY=
12
12
  data.tar.gz: !binary |-
13
- M2I5MWJiODhjNzMxNzY0YjliMjdiNWNhNDllMjdjMTU4NmZlMzY2MmIwNThk
14
- NjQ1MmM5ZjhlNzIzNWZjMmFmYWU3Zjk4ZWI0ZTlmNzg4OTJlMmE2ZTYyZDc2
15
- NmQ5YjZiMmU3YzVlNjUyZTBhMzg5NTIzY2YyZjg1NDUxODc3ZjU=
13
+ ODY5MjJhZGFiZGYxZTRkMzZjMTk1OTI1ODBlNTQxN2YwZTY1NDU3NmVmZTFl
14
+ NjM4NmRlMTEwOGRhMDM3MzkyNTNlOWRkNGRkZjIxZmYwNmFjY2Y3YjM3NzZk
15
+ NDUzMjhhYWZiMmFmMDhhNjJhYmFhMTA4ZjhhZWE0NGJkNjU1ZmM=
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 26 May, 2016 (31f5b82c)](#LATEST)
3
+ * [LATEST - 6 Jun, 2016 (8f6a39db)](#LATEST)
4
+ * [0.5.1 - 26 May, 2016 (c74a3fec)](#0.5.1)
4
5
  * [0.5.0 - 26 May, 2016 (c802e883)](#0.5.0)
5
6
  * [0.4.3 - 10 May, 2016 (5ffdb5f2)](#0.4.3)
6
7
  * [0.4.2 - 28 Apr, 2016 (79ccd5de)](#0.4.2)
@@ -15,7 +16,36 @@
15
16
  * [0.1.0 - 26 Aug, 2015 (ef47972d)](#0.1.0)
16
17
 
17
18
  ## Details
18
- ### <a name = "LATEST">LATEST - 26 May, 2016 (31f5b82c)
19
+ ### <a name = "LATEST">LATEST - 6 Jun, 2016 (8f6a39db)
20
+
21
+ * (GEM) update beaker-answers version to 0.5.2 (8f6a39db)
22
+
23
+ * Merge pull request #19 from ericwilliamson/task/master/PE-16028-update-for-mono (97409f9c)
24
+
25
+
26
+ ```
27
+ Merge pull request #19 from ericwilliamson/task/master/PE-16028-update-for-mono
28
+
29
+ (PE-16028) Update required answers for 2016.2
30
+ ```
31
+ * (PE-16028) Update required answers for 2016.2 (ba130df3)
32
+
33
+
34
+ ```
35
+ (PE-16028) Update required answers for 2016.2
36
+
37
+ Previous to this commit, answer generation for 2016.2 would generate a
38
+ list of parameters on the puppet_enterprise for both mono and split. Due
39
+ to changes introduced in Puppet 4.4, the puppet_enterprsie module no
40
+ longer needs all host parameters in a monolithic install case.
41
+ This commit updates the generation to match what the module has changed
42
+ to use. For a monolithic install, the only required answers are now the
43
+ console admin password, and puppet_master_host. for split installs with
44
+ PE postgres, just master, console and puppetdb host.
45
+ ```
46
+ ### <a name = "0.5.1">0.5.1 - 26 May, 2016 (c74a3fec)
47
+
48
+ * (HISTORY) update beaker-answers history for gem release 0.5.1 (c74a3fec)
19
49
 
20
50
  * (GEM) update beaker-answers version to 0.5.1 (31f5b82c)
21
51
 
@@ -1,5 +1,5 @@
1
1
  module BeakerAnswers
2
2
  module Version
3
- STRING = '0.5.1'
3
+ STRING = '0.5.2'
4
4
  end
5
5
  end
@@ -76,13 +76,14 @@ module BeakerAnswers
76
76
  puppetdb = only_host_with_role(@hosts, 'database')
77
77
  console = only_host_with_role(@hosts, 'dashboard')
78
78
 
79
- config["#{ns}::certificate_authority_host"] = answer_for(@options, "#{ns}::certificate_authority_host", master.hostname)
80
79
  config["#{ns}::puppet_master_host"] = answer_for(@options, "#{ns}::puppet_master_host", master.hostname)
81
- config["#{ns}::console_host"] = answer_for(@options, "#{ns}::console_host", console.hostname)
82
- config["#{ns}::puppetdb_host"] = answer_for(@options, "#{ns}::puppetdb_host", puppetdb.hostname)
83
- config["#{ns}::database_host"] = answer_for(@options, "#{ns}::database_host", puppetdb.hostname)
84
- config["#{ns}::pcp_broker_host"] = answer_for(@options, "#{ns}::pcp_broker_host", master.hostname)
85
- config["#{ns}::mcollective_middleware_hosts"] = [answer_for(@options, "#{ns}::mcollective_middleware_hosts", master.hostname)]
80
+
81
+ # Monolithic installs now only require the puppet_master_host, so only pass in the console
82
+ # and puppetdb host if it is a split install
83
+ if [master, puppetdb, console].uniq.length != 1
84
+ config["#{ns}::console_host"] = answer_for(@options, "#{ns}::console_host", console.hostname)
85
+ config["#{ns}::puppetdb_host"] = answer_for(@options, "#{ns}::puppetdb_host", puppetdb.hostname)
86
+ end
86
87
 
87
88
  return config
88
89
  end
@@ -1,43 +1,10 @@
1
1
  require 'spec_helper'
2
2
  require 'json'
3
3
 
4
- describe BeakerAnswers::Version20162 do
5
- let( :ver ) { '2016.2.0' }
6
- let( :options ) { StringifyHash.new }
7
- let( :basic_hosts ) { make_hosts( {'pe_ver' => ver } ) }
8
- let( :hosts ) { basic_hosts[0]['roles'] = ['master', 'agent']
9
- basic_hosts[1]['roles'] = ['dashboard', 'agent']
10
- basic_hosts[2]['roles'] = ['database', 'agent']
11
- basic_hosts }
12
- let( :answers ) { BeakerAnswers::Answers.create(ver, hosts, options) }
13
- let( :answer_hash ) { answers.answers }
14
-
15
- it 'adds orchestrator database answers to console' do
16
- expect( answer_hash['vm2'][:q_orchestrator_database_name] ).to be === 'pe-orchestrator'
17
- expect( answer_hash['vm2'][:q_orchestrator_database_user] ).to be === 'Orc3Str8R'
18
- end
19
-
20
- it 'generates valid answers if #answer_string is called' do
21
- expect( answers.answer_string(basic_hosts[2]) ).to match(/q_orchestrator_database_name=pe-orchestrator/)
22
- end
23
-
24
- context 'when generating a hiera config' do
4
+ RSpec.shared_examples 'pe.conf' do
25
5
  let( :options ) { { :format => 'hiera' } }
26
6
  let( :answer_hiera ) { answers.answer_hiera }
27
7
  let( :default_password ) { '~!@#$%^*-/ aZ' }
28
- let( :gold_role_answers ) do
29
- {
30
- "console_admin_password" => default_password,
31
- "puppet_enterprise::use_application_services" => true,
32
- "puppet_enterprise::certificate_authority_host" => basic_hosts[0].hostname,
33
- "puppet_enterprise::puppet_master_host" => basic_hosts[0].hostname,
34
- "puppet_enterprise::console_host" => basic_hosts[1].hostname,
35
- "puppet_enterprise::puppetdb_host" => basic_hosts[2].hostname,
36
- "puppet_enterprise::database_host" => basic_hosts[2].hostname,
37
- "puppet_enterprise::pcp_broker_host" => basic_hosts[0].hostname,
38
- "puppet_enterprise::mcollective_middleware_hosts" => [basic_hosts[0].hostname],
39
- }
40
- end
41
8
  let( :gold_db_answers ) do
42
9
  {
43
10
  "puppet_enterprise::activity_database_user" => 'adsfglkj',
@@ -77,6 +44,14 @@ describe BeakerAnswers::Version20162 do
77
44
  "puppet_enterprise::rbac_database_password" => 'custom-rbac-password',
78
45
  }
79
46
  end
47
+ let( :overridding_parameters ) do
48
+ {
49
+ 'puppet_enterprise::certificate_authority_host' => 'enterpriseca.vm',
50
+ 'puppet_enterprise::console_host' => 'enterpriseconsole.vm',
51
+ 'console_admin_password' => 'testing123',
52
+ }
53
+ end
54
+ let( :gold_answers_with_overrides ) { gold_role_answers.merge(overridding_parameters) }
80
55
 
81
56
  it 'should not have nil keys or values' do
82
57
  answer_hash.each_pair { |k, v|
@@ -177,20 +152,8 @@ describe BeakerAnswers::Version20162 do
177
152
  }
178
153
  end
179
154
 
180
- it 'overrides the defaults when multi-level hash :answers are given' do
181
- expect(answer_hash["puppet_enterprise::certificate_authority_host"]).to be === 'enterpriseca.vm'
182
- end
183
-
184
- it 'overrides the defaults when a :: delimited key is given' do
185
- expect(answer_hash["puppet_enterprise::console_host"]).to be === 'enterpriseconsole.vm'
186
- end
187
-
188
- it 'overrides the console_admin_password default' do
189
- expect(answer_hash["console_admin_password"]).to be === 'testing123'
190
- end
191
-
192
- it 'does not add a duplicate key to the hash' do
193
- expect(answer_hash.length).to eq(gold_role_answers.length)
155
+ it 'matches expected answers' do
156
+ expect(answer_hash).to eq(gold_answers_with_overrides)
194
157
  end
195
158
  end
196
159
 
@@ -208,21 +171,60 @@ describe BeakerAnswers::Version20162 do
208
171
  }
209
172
  end
210
173
 
211
- it 'overrides the defaults when multi-level hash :answers are given' do
212
- expect(answer_hash["puppet_enterprise::certificate_authority_host"]).to be === 'enterpriseca.vm'
174
+ it 'matches expected answers' do
175
+ expect(answer_hash).to eq(gold_answers_with_overrides)
213
176
  end
177
+ end
178
+ end
214
179
 
215
- it 'overrides the defaults when a :: delimited key is given' do
216
- expect(answer_hash["puppet_enterprise::console_host"]).to be === 'enterpriseconsole.vm'
217
- end
180
+ describe BeakerAnswers::Version20162 do
181
+ let( :ver ) { '2016.2.0' }
182
+ let( :options ) { StringifyHash.new }
183
+ let( :basic_hosts ) { make_hosts( {'pe_ver' => ver } ) }
184
+ let( :hosts ) { basic_hosts[0]['roles'] = ['master', 'agent']
185
+ basic_hosts[1]['roles'] = ['dashboard', 'agent']
186
+ basic_hosts[2]['roles'] = ['database', 'agent']
187
+ basic_hosts }
188
+ let( :answers ) { BeakerAnswers::Answers.create(ver, hosts, options) }
189
+ let( :answer_hash ) { answers.answers }
190
+
191
+ it 'adds orchestrator database answers to console' do
192
+ expect( answer_hash['vm2'][:q_orchestrator_database_name] ).to be === 'pe-orchestrator'
193
+ expect( answer_hash['vm2'][:q_orchestrator_database_user] ).to be === 'Orc3Str8R'
194
+ end
195
+
196
+ it 'generates valid answers if #answer_string is called' do
197
+ expect( answers.answer_string(basic_hosts[2]) ).to match(/q_orchestrator_database_name=pe-orchestrator/)
198
+ end
218
199
 
219
- it 'overrides the console_admin_password default' do
220
- expect(answer_hash["console_admin_password"]).to be === 'testing123'
200
+ context 'when generating a hiera config' do
201
+ context 'for a monolithic install' do
202
+ let( :basic_hosts ) { make_hosts( {'pe_ver' => ver }, 1 ) }
203
+ let( :hosts ) { basic_hosts[0]['roles'] = ['master', 'agent', 'dashboard', 'database']
204
+ basic_hosts }
205
+ let( :gold_role_answers ) do
206
+ {
207
+ "console_admin_password" => default_password,
208
+ "puppet_enterprise::use_application_services" => true,
209
+ "puppet_enterprise::puppet_master_host" => basic_hosts[0].hostname,
210
+ }
221
211
  end
222
212
 
223
- it 'does not add duplicate keys to the hash' do
224
- expect(answer_hash.length).to eq(gold_role_answers.length)
213
+ include_examples 'pe.conf'
214
+ end
215
+
216
+ context 'for a split install' do
217
+ let( :gold_role_answers ) do
218
+ {
219
+ "console_admin_password" => default_password,
220
+ "puppet_enterprise::use_application_services" => true,
221
+ "puppet_enterprise::puppet_master_host" => basic_hosts[0].hostname,
222
+ "puppet_enterprise::console_host" => basic_hosts[1].hostname,
223
+ "puppet_enterprise::puppetdb_host" => basic_hosts[2].hostname,
224
+ }
225
225
  end
226
+
227
+ include_examples 'pe.conf'
226
228
  end
227
229
  end
228
230
 
@@ -362,5 +364,4 @@ describe BeakerAnswers::Version20162 do
362
364
  },
363
365
  })
364
366
  end
365
-
366
367
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-answers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-27 00:00:00.000000000 Z
12
+ date: 2016-06-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec