beaker-answers 0.4.3 → 0.5.0

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
- MjA5Nzc1NDk5NTY3Nzk2YTg3MWY5ZmM3MmEwZTE2NzI5MGU0Nzc1OQ==
4
+ YzAyMDhhMmFjNDQ5MGVmYTk4OWI4ZTE4NDI4YmE4OGU5YjkxYzRiYg==
5
5
  data.tar.gz: !binary |-
6
- MDM1MTA5MmU3YWJjODQ2ODliNWIyNjk4MTBkMmJjYzBjNTRhYzdhMQ==
6
+ YTY3ZDI2ODU1OWY5NTdmNmYzMzdjMzgwN2JlNTEwZWIzMWRjNWM5OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTkyNzFlNjdlNTE0YTJlMjc5ZjNkNjdlNjQyZmQ0YmZlZWJmODAxNWIzMWQ3
10
- ODliZGI1NDgzMjBiMWI4MTUxNjU4OTc4M2Y5OTdjZTBmYjA2NmE5NjE5MTVh
11
- Yzc0OWE3MzkzMjMzYjRjY2NiNzkyZGQzMGQ4YWZhY2U0ZmIzMzg=
9
+ MjQ3NTAwMjBlMjQzNmI3NDhjYjcyOWUyOTk5NGU2ODBmMGEwMDYxNTU4NzVk
10
+ YTExMzYzMGExMjkwNTIyNDgyZTk1MGI0Y2IzZTM3NTk2YTQ5ZjA2ODIxMzcy
11
+ ZmRiOTJhMjFmNTg1YzRmZTk2OTQwYWVkZGVhNmI2ZDg4NDRhYjI=
12
12
  data.tar.gz: !binary |-
13
- YTZjNWYxMjIxYjM1NmJhMGQ0M2VhNTM3ZWZlNmJhZDlhYmE2MDQ5NDg5Y2Vh
14
- ODRmMDAzODY4YjVmZWUwYzAzNGRlMDM4MWMwYWM2ZDNjNmExYTFiYjQyNGNj
15
- YmE0ZmU5ZmY0M2RlMTllZjE2NzhkZWQ2ZGY1OGZjOTdjZmJlMmE=
13
+ NmM2MTZjYjYxZDUzYTI5NzM1M2FmN2M5YjJkMTJkZmUzZmIzZjNiZmIxMWM4
14
+ YWUzMGE3NTI0N2U0ZTFhNDJmOWViOTBkZGM0ZDU5MWE2MWYwZTFiZGE3NmQz
15
+ MDI2ZWIzM2NiZmZlY2ExYWUxYjYyMjJmZTNmZjI5YWM2MTEyNTE=
data/Gemfile CHANGED
@@ -1,3 +1,7 @@
1
1
  source ENV['GEM_SOURCE'] || "https://rubygems.org"
2
2
 
3
3
  gemspec
4
+
5
+ if File.exists? "#{__FILE__}.local"
6
+ eval(File.read("#{__FILE__}.local"), binding)
7
+ end
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 10 May, 2016 (92edeb28)](#LATEST)
3
+ * [LATEST - 26 May, 2016 (3045251c)](#LATEST)
4
+ * [0.4.3 - 10 May, 2016 (5ffdb5f2)](#0.4.3)
4
5
  * [0.4.2 - 28 Apr, 2016 (79ccd5de)](#0.4.2)
5
6
  * [0.4.1 - 28 Apr, 2016 (d9d14510)](#0.4.1)
6
7
  * [0.4.0 - 12 Feb, 2016 (96d0d7cf)](#0.4.0)
@@ -13,7 +14,400 @@
13
14
  * [0.1.0 - 26 Aug, 2015 (ef47972d)](#0.1.0)
14
15
 
15
16
  ## Details
16
- ### <a name = "LATEST">LATEST - 10 May, 2016 (92edeb28)
17
+ ### <a name = "LATEST">LATEST - 26 May, 2016 (3045251c)
18
+
19
+ * (GEM) update beaker-answers version to 0.5.0 (3045251c)
20
+
21
+ * Merge pull request #16 from highb/feature/master/pe-14996_add_hiera_answers (e724b683)
22
+
23
+
24
+ ```
25
+ Merge pull request #16 from highb/feature/master/pe-14996_add_hiera_answers
26
+
27
+ (PE-14996) Add hiera type answer/config generation
28
+ ```
29
+ * (PE-14996) Ensure flatten_keys_to_joined_string generates strings (bdbd3c2a)
30
+
31
+
32
+ ```
33
+ (PE-14996) Ensure flatten_keys_to_joined_string generates strings
34
+
35
+ Prior to this commit I didn't ensure that keys being given in hashes
36
+ to `flatten_keys_to_joined_string` were being converted to strings.
37
+ This would result in keys that were passed in as symbols acting as a
38
+ duplicate key to the string equivalent, which were then written out
39
+ by the json/hocon parsers because it seems they do not have a uniqueness
40
+ constraint on keys in hashes.
41
+ This commit changes `flatten_keys_to_joined_string` to always convert
42
+ the keys to strings, which should prevent this sort of duplicate key
43
+ issue.
44
+ ```
45
+ * (PE-15259) Only include legacy database user defaults if prompted (6748295e)
46
+
47
+
48
+ ```
49
+ (PE-15259) Only include legacy database user defaults if prompted
50
+
51
+ If beaker-pe initializes BeakerAnswers with an
52
+ :include_legacy_database_defaults, then add custom database users from
53
+ BeakerAnswers::DEFAULT_ANSWERS. This is only necessary if we are
54
+ upgrading from a pre-meep Beaker install of PE where BeakerAnswers
55
+ changed the default user names.
56
+
57
+ Setting the old legacy database password defaults is never required.
58
+
59
+ To override any of these settings, they should be added directly to the
60
+ :answers hash in the host.cfg file.
61
+ ```
62
+ * (maint) Include Gemfile.local (af435a64)
63
+
64
+
65
+ ```
66
+ (maint) Include Gemfile.local
67
+
68
+ Allows addition gems (such as a debugger) to be included for development
69
+ without accidentally commiting them.
70
+ ```
71
+ * (PE-14996) Verify answers for default, cert auth and upgrade cases (fd1f8014)
72
+
73
+
74
+ ```
75
+ (PE-14996) Verify answers for default, cert auth and upgrade cases
76
+
77
+ Fixes a spec failure that occurred from
78
+ c4556d8e455617c84ce3faf805a34fbee25bac92 given that database name/user
79
+ were no longer present by default. Also changes the specs to explicitly
80
+ define hashes of expected values so we don't miss any changes
81
+ (use_application_services wasn't being tested, for example), and hard
82
+ codes expected constants so that we don't have false positives from both
83
+ expectations and results coming indirectly from internal code references and
84
+ accidentally matching.
85
+ ```
86
+ * (PE-14996) Change upgrade answers spec to be literal strings (f996c1b5)
87
+
88
+
89
+ ```
90
+ (PE-14996) Change upgrade answers spec to be literal strings
91
+
92
+ Even though we reverted the DEFAULT_ANSWERS change to no longer have
93
+ quotes within the answer values, the spec tests were still passing, even
94
+ though they would generate erroneous answers for the
95
+ puppetdb_database_password. This change makes it so that the tests are
96
+ testing for literal strings, as opposed to just ensuring the calculation
97
+ for the answer happens.
98
+ ```
99
+ * (PE-14996) Guard addition of database_name, database_user by upgrade (c4556d8e)
100
+
101
+
102
+ ```
103
+ (PE-14996) Guard addition of database_name, database_user by upgrade
104
+
105
+ BeakerAnswers historically sets database user/name to non default
106
+ values. Typically a user will not do this, and it complicates our
107
+ default workflow and subsequent upgrades. For meep, with this commit,
108
+ I'm ignoring the database name/user settings if we're not upgrading.
109
+ The reason they are needed on upgrade (currently only from pre-meep
110
+ versions), is that a legacy install laid down by Beaker will have these
111
+ database settings, and we have to have them in pe.conf when upgrading,
112
+ or database access fails.
113
+
114
+ When upgrading from a meep install (2016.2.1+), a pe.conf should not be
115
+ created, and beaker-pe should just call the installer-shim with no
116
+ pe.conf file. https://tickets.puppetlabs.com/browse/PE-15351
117
+ ```
118
+ * (PE-14996) Generate hiera host references from vm.hostname (f005f3f9)
119
+
120
+
121
+ ```
122
+ (PE-14996) Generate hiera host references from vm.hostname
123
+
124
+ ...instead of name. The later is simple the YAML key for the host from
125
+ the Beaker hosts.cfg file, while the former, in the case of vmpooler
126
+ hosts, is the actual hostname from the generated vm. It is this
127
+ hostname that is required for a working pe.conf.
128
+ ```
129
+ * (PE-14996) Treat q_puppetdb_database_password default same as others (40b5f9a8)
130
+
131
+
132
+ ```
133
+ (PE-14996) Treat q_puppetdb_database_password default same as others
134
+
135
+ 181305f6ba6116d05c8163eb2a18243df30098d0 changed beaker-answers so that
136
+ the puppetdb default was referenced by its answer
137
+ q_puppetdb_database_password, rather than the key q_puppetdb_password,
138
+ which is not used in the legacy answer file. Due to how answer_for()
139
+ works, where an existing value looked up from DEFAULTS prevents the
140
+ passed default override from being used, this caused the generated
141
+ answer for puppetdb to added without quotes. To fix this, quotes were
142
+ added to the default. This worked, but it ran counter to how the later
143
+ database answers for classifier, rbac, activity and orchestrator
144
+ database passwords were handled. These had defaults without quotes, and
145
+ then explicitly quoted the derived answers generated for the
146
+ answers_hash.
147
+
148
+ When we began using answers for generating a hiera config for meep, this
149
+ caused problems with the puppetdb password because the quotes in the
150
+ puppetdb default ended up in the json value, causing an error in
151
+ Postgres.
152
+
153
+ To fix this, and to unify q_puppetdb_database_password's handling with
154
+ that of the other db passwords, this commit removes the quoting in the
155
+ defaults, and adds it to the generation of the final
156
+ q_puppetdb_database_password answer. It also modified a spec that was
157
+ testing the generation of this answer to take into account that the
158
+ quotes are added by the answer generation process.
159
+ ```
160
+ * (PE-14996) Fix test for legacy answers in hiera_config to handle symbols (1e8d51f8)
161
+
162
+
163
+ ```
164
+ (PE-14996) Fix test for legacy answers in hiera_config to handle symbols
165
+
166
+ Beaker configs in this format:
167
+
168
+ :answers:
169
+ :q_puppet_enterpriseconsole_auth_password: puppetlabs
170
+ :q_puppet_enterpriseconsole_auth_user_email: admin@puppetlabs.net
171
+ CONFIG:
172
+ log_level: debug
173
+ HOSTS:
174
+ master.vm:
175
+ platform: el-7-x86_64
176
+ ...
177
+
178
+ where legacy answers are provided to be slurped into Beaker options and
179
+ passed on to BeakerAnswers, were failing when BeakerAnswers was
180
+ attempting to produce a 2016.2.x hiera config for meep. This was just
181
+ because the test was assuming strings for keys instead of symbols. The
182
+ patch converts to string before testing and adds a spec.
183
+ ```
184
+ * (PE-14996) Prefer let() to instance variables (d8eec98d)
185
+
186
+
187
+ ```
188
+ (PE-14996) Prefer let() to instance variables
189
+
190
+ Makes use of rspec's let method instead of instance variables for
191
+ consistency. Also removes extraneous 'should' from spec names.
192
+ ```
193
+ * (PE-14996) Update q_puppetdb_password to q_puppetdb_database_password (040601c1)
194
+
195
+
196
+ ```
197
+ (PE-14996) Update q_puppetdb_password to q_puppetdb_database_password
198
+
199
+ PR #15 changed the name of the puppetdb database password key in the
200
+ default hash. This commit will update the hiera default hash (which
201
+ reads values from the original defaults hash in order to reduce
202
+ duplication) to use the correct key from the old default hash.
203
+ ```
204
+ * (PE-14996) Remove duplicate default key (8a22b338)
205
+
206
+
207
+ ```
208
+ (PE-14996) Remove duplicate default key
209
+
210
+ There were two entries for `puppetdb_database_name` in the defaults
211
+ array. This shouldn't cause any issues, but also doesn't do anything
212
+ so I'm cleaning it up.
213
+ ```
214
+ * Merge pull request #15 from tvpartytonight/BKR-763 (50589d17)
215
+
216
+
217
+ ```
218
+ Merge pull request #15 from tvpartytonight/BKR-763
219
+
220
+ (BKR-763) Add upgrade answers for PE 3.8.x
221
+ ```
222
+ * (PE-14996) Provide a format agnostic method for configuration string (9209aa3b)
223
+
224
+
225
+ ```
226
+ (PE-14996) Provide a format agnostic method for configuration string
227
+
228
+ With the changes in installer configuration format, Version201620 now
229
+ has an answer_hiera method. However the component using beaker-answers
230
+ shouldn't have to care about which output method it calls to get a
231
+ configuration. Ultimately it should just expect the correct
232
+ configuration for a given PE version. To assist with this, this commit
233
+ adds an installer_configuration_string(host) method which will return
234
+ either an answer file string or a hiera pe.conf string depending on the
235
+ :format setting.
236
+
237
+ Because no version prior to 2016.2.0 can work with a hiera pe.conf, I've
238
+ moved the implementation into Version201620 and left an erroring stub in
239
+ Answers.
240
+ ```
241
+ * (PE-14996) Use :format in options instead of @type as param (0cf01296)
242
+
243
+
244
+ ```
245
+ (PE-14996) Use :format in options instead of @type as param
246
+
247
+ Prior to this commit I was adding a type param to the init/create
248
+ methods of `Answers` in order to specify which answers file type
249
+ to generate. Using the word type, which is already used to specify
250
+ `:install` vs `:upgrade`, and creating a whole new param were
251
+ somewhat counter-intuitive and confusing.
252
+
253
+ This commit removes the type param, and instead reads the `:format`
254
+ key from the `options` hash upon initialization, and if it cannot find
255
+ a value at that key, it will default to `:bash`. I went back to using
256
+ `:format` in order to reduce the chance of us later being confused
257
+ by the `:type` option and decided to use the options hash because that
258
+ is how we have typically interacted with the `Answers` library in the
259
+ past. This should hopefully be a more intuitive and less error prone
260
+ way of interacting with the library. Fingers crossed.
261
+ ```
262
+ * (PE-14996) Use case for determining answer type (3b9838f3)
263
+
264
+
265
+ ```
266
+ (PE-14996) Use case for determining answer type
267
+
268
+ Prior to this commit we were using a series of if statements
269
+ when checking if we support the answer `type` provided.
270
+ This commit changes those checks to use a case statement in order
271
+ to clean up the logic. Additionally, more exceptions will be raised
272
+ if methods are called with an unknown `type`.
273
+ ```
274
+ * (PE-14996) Move hocon/json include to base BeakerAnswers lib (60ae45b0)
275
+
276
+
277
+ ```
278
+ (PE-14996) Move hocon/json include to base BeakerAnswers lib
279
+
280
+ Prior to this commit we were requiring the json/hocon libs only
281
+ in the `Answers` class.
282
+ This commit moves those requires to the base `BeakerAnswers`, so
283
+ we can re-use those libraries elsewhere without needing to require
284
+ them.
285
+ ```
286
+ * (PE-14996) Add specs for #answers_hiera and #answers_string (6a546add)
287
+
288
+
289
+ ```
290
+ (PE-14996) Add specs for #answers_hiera and #answers_string
291
+
292
+ Prior to this commit we were not spec testing `answers_hiera` or
293
+ `answers_string`.
294
+
295
+ This commit adds specs for both to the 20162 answers class, as well
296
+ as resolving an issue found in code review/spec testing with
297
+ the `answer_hiera` method.
298
+ ```
299
+ * (PE-14996) Further refactor default config generation (37c76194)
300
+
301
+
302
+ ```
303
+ (PE-14996) Further refactor default config generation
304
+
305
+ Prior to this commit there was a large amount of duplicate code
306
+ used for getting the `answer_for` for each key.
307
+
308
+ This commit refactors that duplicate code out into a method on
309
+ the Answers class that takes an array of desired defaults and
310
+ returns an array with either the default from the Answers class
311
+ or the user-provider override.
312
+
313
+ Additionally, instead of them hiera answers, we should be calling
314
+ them hiera config in order to be consistent with how we are documenting
315
+ them and what they really are; persistent configuration that will be
316
+ saved on the system.
317
+ ```
318
+ * (PE-14996) Abstract bash vs hiera answer generation logic (86ea430b)
319
+
320
+
321
+ ```
322
+ (PE-14996) Abstract bash vs hiera answer generation logic
323
+
324
+ Prior to this commit the bash and hiera answer generation logic were
325
+ all crammed into the `generate_answers` method on 20162.
326
+ This commit abstracts the bash and hiera answer generation logic into
327
+ two separate methods: `generate_bash_answers` and
328
+ `generate_hiera_answers`. This should make the answers generation a
329
+ little easier to follow.
330
+ ```
331
+ * (PE-14996) Update format variable to type (ffcb41ec)
332
+
333
+
334
+ ```
335
+ (PE-14996) Update format variable to type
336
+
337
+ Prior to this commit I forgot to change all the instances of the
338
+ variable I originally named `format` to `type`.
339
+ This commit fixes one of the instances I missed and I grepped the
340
+ project to ensure there were no others.
341
+ ```
342
+ * (PE-14996) Add DB user/name to default hiera configs (5627a94a)
343
+
344
+
345
+ ```
346
+ (PE-14996) Add DB user/name to default hiera configs
347
+
348
+ Prior to this commit we were not specifying the old default
349
+ DB user/names in the hiera configs, which could result in tests
350
+ that depend on those names to fail. Additionally, it is a good
351
+ idea to verify that specifying a non-default database name still
352
+ works.
353
+ This commit specifies puppetdb, classifier, activity, rbac and
354
+ orchestrator database names by default for the 2016.2 hiera
355
+ config/answer files. console/console_auth are omitted because
356
+ those databases are deprecated in 2016.2.
357
+
358
+ Also fixed a typo where `q_database_name` was specified in the
359
+ defaults hash instead of `q_classifier_database_name` and fixed
360
+ the only reference to that (from 3.4).
361
+ ```
362
+ * (PE-14996) Prevent q_ answer overrides in hiera (8e9f4202)
363
+
364
+
365
+ ```
366
+ (PE-14996) Prevent q_ answer overrides in hiera
367
+
368
+ Prior to this commit if a user was still providing `q_` style
369
+ answer overrides, we would still add them to the hash.
370
+ This commit changes that behavior to raise an exception if a `q_`
371
+ answer is provided when we are generating hiera style answers.
372
+ ```
373
+ * (PE-14996) Allow overrides of 2016.2 hiera answers (3bee87d2)
374
+
375
+
376
+ ```
377
+ (PE-14996) Allow overrides of 2016.2 hiera answers
378
+
379
+ Prior to this commit there was not method for overriding the
380
+ default answers given for the new 2016.2 hiera answer format.
381
+ This commit adds a method of overriding those answers via providing
382
+ a hash to `options[:answers]` containing all the hiera values that
383
+ you wish to override or add.
384
+ ```
385
+ * (PE-14996) Add initial work for 2016.2 hiera answers (2638e57a)
386
+
387
+
388
+ ```
389
+ (PE-14996) Add initial work for 2016.2 hiera answers
390
+
391
+ Initial commit based off @ericwilliamson prototype code for
392
+ generating hiera answers for 2016.2 meep/idempotent installs.
393
+
394
+ Added initial spec tests to verify hash generation is adding the
395
+ correct values.
396
+ ```
397
+ * (BKR-763) Add upgrade answers for PE 3.8.x (181305f6)
398
+
399
+
400
+ ```
401
+ (BKR-763) Add upgrade answers for PE 3.8.x
402
+
403
+ This PR specifically targets answers for upgrading to PE 3.8.x. It adds
404
+ a new subclassed branch directly from `Answers` and looks for the
405
+ `options[:type][:upgrade]` option from beaker. All other upgrade types
406
+ will continue to create full answer sets.
407
+ ```
408
+ ### <a name = "0.4.3">0.4.3 - 10 May, 2016 (5ffdb5f2)
409
+
410
+ * (HISTORY) update beaker-answers history for gem release 0.4.3 (5ffdb5f2)
17
411
 
18
412
  * (GEM) update beaker-answers version to 0.4.3 (92edeb28)
19
413
 
@@ -33,6 +33,6 @@ Gem::Specification.new do |s|
33
33
  # Run time dependencies
34
34
  s.add_runtime_dependency 'stringify-hash', '~> 0.0.0'
35
35
  s.add_runtime_dependency 'require_all', '~> 1.3.2'
36
+ s.add_runtime_dependency 'hocon', '~> 0.9.5'
36
37
 
37
38
  end
38
-