cem_acpt 0.6.2 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e2aaf3de96bb10c9091d11e8d5e2e9680cd07bd601fa349be1c75db15e7428e
4
- data.tar.gz: 3ac23bcddfd8ebd461d437de6b77454a19bf6e72ebd7e1986b76c5601f8e87c2
3
+ metadata.gz: 52762f33465c435a0c6009002d7915dd249c145210493cd503936e7e816177a2
4
+ data.tar.gz: 6b7f8cb35ed65f914269ae0a5179a89f7ca3cc4d0f0d940bfd9a913b0c2cabf2
5
5
  SHA512:
6
- metadata.gz: 8eeb0684612c1df4d7d1087bc411a351906c475b5ad9d32b61221023efc806a4137c74bb926e700cbe21ee36d1d0f5d1dd2915e7f006102ac9b5c872de82d97b
7
- data.tar.gz: f7fce1e31b862cabfb19aba1e3ce8c0c32e9e99b80ca892dba64f7cfd711ebf6a64a253470803ce0dac9b65da3af2a7e02d2f8597c552e891e785cc4960fc27e
6
+ metadata.gz: e6e1a5986dda72b212bb344c8b62ddceb5ca8277be3fc392ff6f5dea61981a1666ace99f205a43d7ba63013d4fce0e509ec48819e4a96e9577fa5dbae52c180f
7
+ data.tar.gz: 529dbb05eabffe98ee9c7feaa1635858245d4ac20d681451a43d377c04a42f77516371c986c1a5add2c719631e8625dd454471b99fbb1e5270c8ee1d49ce4127
data/.rubocop.yml ADDED
@@ -0,0 +1,528 @@
1
+ ---
2
+ require:
3
+ - rubocop-performance
4
+ - rubocop-rspec
5
+ AllCops:
6
+ NewCops: enable
7
+ SuggestExtensions: false
8
+ DisplayCopNames: true
9
+ TargetRubyVersion: '3.2'
10
+ Include:
11
+ - "**/*.rb"
12
+ Exclude:
13
+ - bin/*
14
+ - ".vendor/**/*"
15
+ - "**/Gemfile"
16
+ - "**/Rakefile"
17
+ - pkg/**/*
18
+ - vendor/**/*
19
+ Layout/LineLength:
20
+ Description: People have wide screens, use them.
21
+ Max: 200
22
+ RSpec/HookArgument:
23
+ Description: Prefer explicit :each argument, matching existing module's style
24
+ EnforcedStyle: each
25
+ Style/BlockDelimiters:
26
+ Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
27
+ be consistent then.
28
+ EnforcedStyle: braces_for_chaining
29
+ Style/ClassAndModuleChildren:
30
+ Enabled: false
31
+ Style/EmptyElse:
32
+ Description: Enforce against empty else clauses, but allow `nil` for clarity.
33
+ EnforcedStyle: empty
34
+ Style/FormatString:
35
+ Description: Following the main puppet project's style, prefer the % format format.
36
+ EnforcedStyle: percent
37
+ Style/FormatStringToken:
38
+ Description: Following the main puppet project's style, prefer the simpler template
39
+ tokens over annotated ones.
40
+ EnforcedStyle: template
41
+ Style/Lambda:
42
+ Description: Prefer the keyword for easier discoverability.
43
+ EnforcedStyle: literal
44
+ Style/RegexpLiteral:
45
+ Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
46
+ EnforcedStyle: percent_r
47
+ Style/TernaryParentheses:
48
+ Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
49
+ on complex expressions for better readability, but seriously consider breaking
50
+ it up.
51
+ EnforcedStyle: require_parentheses_when_complex
52
+ Style/TrailingCommaInArguments:
53
+ Description: Prefer always trailing comma on multiline argument lists. This makes
54
+ diffs, and re-ordering nicer.
55
+ EnforcedStyleForMultiline: comma
56
+ Style/TrailingCommaInArrayLiteral:
57
+ Description: Prefer always trailing comma on multiline literals. This makes diffs,
58
+ and re-ordering nicer.
59
+ EnforcedStyleForMultiline: comma
60
+ Style/SymbolArray:
61
+ Enabled: false
62
+ Lint/ScriptPermission:
63
+ Enabled: false
64
+ Style/IfInsideElse:
65
+ Enabled: false
66
+ RSpec/MessageSpies:
67
+ EnforcedStyle: receive
68
+ Style/WordArray:
69
+ Enabled: false
70
+ Performance/AncestorsInclude:
71
+ Enabled: true
72
+ Performance/BigDecimalWithNumericArgument:
73
+ Enabled: true
74
+ Performance/BlockGivenWithExplicitBlock:
75
+ Enabled: true
76
+ Performance/CaseWhenSplat:
77
+ Enabled: true
78
+ Performance/ConstantRegexp:
79
+ Enabled: true
80
+ Performance/MethodObjectAsBlock:
81
+ Enabled: true
82
+ Performance/RedundantSortBlock:
83
+ Enabled: true
84
+ Performance/RedundantStringChars:
85
+ Enabled: true
86
+ Performance/ReverseFirst:
87
+ Enabled: true
88
+ Performance/SortReverse:
89
+ Enabled: true
90
+ Performance/Squeeze:
91
+ Enabled: true
92
+ Performance/StringInclude:
93
+ Enabled: true
94
+ Performance/Sum:
95
+ Enabled: true
96
+ Style/CollectionMethods:
97
+ Enabled: true
98
+ Style/MethodCalledOnDoEndBlock:
99
+ Enabled: true
100
+ Style/StringMethods:
101
+ Enabled: true
102
+ Bundler/InsecureProtocolSource:
103
+ Enabled: false
104
+ Gemspec/DuplicatedAssignment:
105
+ Enabled: false
106
+ Gemspec/OrderedDependencies:
107
+ Enabled: false
108
+ Gemspec/RequiredRubyVersion:
109
+ Enabled: false
110
+ Gemspec/RubyVersionGlobalsUsage:
111
+ Enabled: false
112
+ Layout/ArgumentAlignment:
113
+ Enabled: false
114
+ Layout/BeginEndAlignment:
115
+ Enabled: false
116
+ Layout/ClosingHeredocIndentation:
117
+ Enabled: false
118
+ Layout/EmptyComment:
119
+ Enabled: false
120
+ Layout/EmptyLineAfterGuardClause:
121
+ Enabled: false
122
+ Layout/EmptyLinesAroundArguments:
123
+ Enabled: false
124
+ Layout/EmptyLinesAroundAttributeAccessor:
125
+ Enabled: false
126
+ Layout/EndOfLine:
127
+ Enabled: false
128
+ Layout/FirstArgumentIndentation:
129
+ Enabled: false
130
+ Layout/HashAlignment:
131
+ Enabled: false
132
+ Layout/HeredocIndentation:
133
+ Enabled: false
134
+ Layout/LeadingEmptyLines:
135
+ Enabled: false
136
+ Layout/SpaceAroundMethodCallOperator:
137
+ Enabled: false
138
+ Layout/SpaceInsideArrayLiteralBrackets:
139
+ Enabled: false
140
+ Layout/SpaceInsideReferenceBrackets:
141
+ Enabled: false
142
+ Lint/BigDecimalNew:
143
+ Enabled: false
144
+ Lint/BooleanSymbol:
145
+ Enabled: false
146
+ Lint/ConstantDefinitionInBlock:
147
+ Enabled: false
148
+ Lint/DeprecatedOpenSSLConstant:
149
+ Enabled: false
150
+ Lint/DisjunctiveAssignmentInConstructor:
151
+ Enabled: false
152
+ Lint/DuplicateElsifCondition:
153
+ Enabled: false
154
+ Lint/DuplicateRequire:
155
+ Enabled: false
156
+ Lint/DuplicateRescueException:
157
+ Enabled: false
158
+ Lint/EmptyConditionalBody:
159
+ Enabled: false
160
+ Lint/EmptyFile:
161
+ Enabled: false
162
+ Lint/ErbNewArguments:
163
+ Enabled: false
164
+ Lint/FloatComparison:
165
+ Enabled: false
166
+ Lint/HashCompareByIdentity:
167
+ Enabled: false
168
+ Lint/IdentityComparison:
169
+ Enabled: false
170
+ Lint/InterpolationCheck:
171
+ Enabled: false
172
+ Lint/MissingCopEnableDirective:
173
+ Enabled: false
174
+ Lint/MixedRegexpCaptureTypes:
175
+ Enabled: false
176
+ Lint/NestedPercentLiteral:
177
+ Enabled: false
178
+ Lint/NonDeterministicRequireOrder:
179
+ Enabled: false
180
+ Lint/OrderedMagicComments:
181
+ Enabled: false
182
+ Lint/OutOfRangeRegexpRef:
183
+ Enabled: false
184
+ Lint/RaiseException:
185
+ Enabled: false
186
+ Lint/RedundantCopEnableDirective:
187
+ Enabled: false
188
+ Lint/RedundantRequireStatement:
189
+ Enabled: false
190
+ Lint/RedundantSafeNavigation:
191
+ Enabled: false
192
+ Lint/RedundantWithIndex:
193
+ Enabled: false
194
+ Lint/RedundantWithObject:
195
+ Enabled: false
196
+ Lint/RegexpAsCondition:
197
+ Enabled: false
198
+ Lint/ReturnInVoidContext:
199
+ Enabled: false
200
+ Lint/SafeNavigationConsistency:
201
+ Enabled: false
202
+ Lint/SafeNavigationWithEmpty:
203
+ Enabled: false
204
+ Lint/SelfAssignment:
205
+ Enabled: false
206
+ Lint/SendWithMixinArgument:
207
+ Enabled: false
208
+ Lint/ShadowedArgument:
209
+ Enabled: false
210
+ Lint/StructNewOverride:
211
+ Enabled: false
212
+ Lint/ToJSON:
213
+ Enabled: false
214
+ Lint/TopLevelReturnWithArgument:
215
+ Enabled: false
216
+ Lint/TrailingCommaInAttributeDeclaration:
217
+ Enabled: false
218
+ Lint/UnreachableLoop:
219
+ Enabled: false
220
+ Lint/UriEscapeUnescape:
221
+ Enabled: false
222
+ Lint/UriRegexp:
223
+ Enabled: false
224
+ Lint/UselessMethodDefinition:
225
+ Enabled: false
226
+ Lint/UselessTimes:
227
+ Enabled: false
228
+ Metrics/AbcSize:
229
+ Enabled: false
230
+ Metrics/BlockLength:
231
+ Enabled: false
232
+ Metrics/BlockNesting:
233
+ Enabled: false
234
+ Metrics/ClassLength:
235
+ Max: 1000
236
+ Metrics/CyclomaticComplexity:
237
+ Enabled: false
238
+ Metrics/MethodLength:
239
+ Max: 1000
240
+ Metrics/ModuleLength:
241
+ Enabled: false
242
+ Metrics/ParameterLists:
243
+ Enabled: false
244
+ Metrics/PerceivedComplexity:
245
+ Enabled: false
246
+ Migration/DepartmentName:
247
+ Enabled: false
248
+ Naming/AccessorMethodName:
249
+ Enabled: false
250
+ Naming/BlockParameterName:
251
+ Enabled: false
252
+ Naming/FileName:
253
+ Exclude:
254
+ - spec/acceptance/**/*
255
+ Naming/HeredocDelimiterCase:
256
+ Enabled: false
257
+ Naming/HeredocDelimiterNaming:
258
+ Enabled: false
259
+ Naming/MemoizedInstanceVariableName:
260
+ Enabled: false
261
+ Naming/MethodParameterName:
262
+ Enabled: false
263
+ Naming/RescuedExceptionsVariableName:
264
+ Enabled: false
265
+ Naming/VariableNumber:
266
+ Enabled: false
267
+ Performance/BindCall:
268
+ Enabled: false
269
+ Performance/DeletePrefix:
270
+ Enabled: false
271
+ Performance/DeleteSuffix:
272
+ Enabled: false
273
+ Performance/InefficientHashSearch:
274
+ Enabled: false
275
+ Performance/UnfreezeString:
276
+ Enabled: false
277
+ Performance/UriDefaultParser:
278
+ Enabled: false
279
+ RSpec/Be:
280
+ Enabled: false
281
+ RSpec/BeEq:
282
+ Enabled: false
283
+ RSpec/Capybara/CurrentPathExpectation:
284
+ Enabled: false
285
+ RSpec/Capybara/FeatureMethods:
286
+ Enabled: false
287
+ RSpec/Capybara/VisibilityMatcher:
288
+ Enabled: false
289
+ RSpec/ClassCheck:
290
+ Enabled: false
291
+ RSpec/ContextMethod:
292
+ Enabled: false
293
+ RSpec/ContextWording:
294
+ Enabled: false
295
+ RSpec/DescribeClass:
296
+ Enabled: false
297
+ RSpec/EmptyHook:
298
+ Enabled: false
299
+ RSpec/EmptyLineAfterExample:
300
+ Enabled: false
301
+ RSpec/EmptyLineAfterExampleGroup:
302
+ Enabled: false
303
+ RSpec/EmptyLineAfterHook:
304
+ Enabled: false
305
+ RSpec/ExampleLength:
306
+ Enabled: false
307
+ RSpec/ExampleWithoutDescription:
308
+ Enabled: false
309
+ RSpec/ExpectChange:
310
+ Enabled: false
311
+ RSpec/ExpectInHook:
312
+ Enabled: false
313
+ RSpec/FactoryBot/AttributeDefinedStatically:
314
+ Enabled: false
315
+ RSpec/FactoryBot/CreateList:
316
+ Enabled: false
317
+ RSpec/FactoryBot/FactoryClassName:
318
+ Enabled: false
319
+ RSpec/HooksBeforeExamples:
320
+ Enabled: false
321
+ RSpec/ImplicitBlockExpectation:
322
+ Enabled: false
323
+ RSpec/ImplicitSubject:
324
+ Enabled: false
325
+ RSpec/LeakyConstantDeclaration:
326
+ Enabled: false
327
+ RSpec/LetBeforeExamples:
328
+ Enabled: false
329
+ RSpec/MissingExampleGroupArgument:
330
+ Enabled: false
331
+ RSpec/MultipleExpectations:
332
+ Enabled: false
333
+ RSpec/MultipleMemoizedHelpers:
334
+ Enabled: false
335
+ RSpec/MultipleSubjects:
336
+ Enabled: false
337
+ RSpec/NestedGroups:
338
+ Enabled: false
339
+ RSpec/PredicateMatcher:
340
+ Enabled: false
341
+ RSpec/ReceiveCounts:
342
+ Enabled: false
343
+ RSpec/ReceiveNever:
344
+ Enabled: false
345
+ RSpec/RepeatedExampleGroupBody:
346
+ Enabled: false
347
+ RSpec/RepeatedExampleGroupDescription:
348
+ Enabled: false
349
+ RSpec/RepeatedIncludeExample:
350
+ Enabled: false
351
+ RSpec/ReturnFromStub:
352
+ Enabled: false
353
+ RSpec/SharedExamples:
354
+ Enabled: false
355
+ RSpec/StubbedMock:
356
+ Enabled: false
357
+ RSpec/UnspecifiedException:
358
+ Enabled: false
359
+ RSpec/VariableDefinition:
360
+ Enabled: false
361
+ RSpec/VerifiedDoubleReference:
362
+ Enabled: false
363
+ RSpec/VoidExpect:
364
+ Enabled: false
365
+ RSpec/Yield:
366
+ Enabled: false
367
+ Security/Open:
368
+ Enabled: false
369
+ Style/AccessModifierDeclarations:
370
+ Enabled: false
371
+ Style/AccessorGrouping:
372
+ Enabled: false
373
+ Style/AsciiComments:
374
+ Enabled: false
375
+ Style/BisectedAttrAccessor:
376
+ Enabled: false
377
+ Style/CaseLikeIf:
378
+ Enabled: false
379
+ Style/ClassEqualityComparison:
380
+ Enabled: false
381
+ Style/ColonMethodDefinition:
382
+ Enabled: false
383
+ Style/CombinableLoops:
384
+ Enabled: false
385
+ Style/CommentedKeyword:
386
+ Enabled: false
387
+ Style/Dir:
388
+ Enabled: false
389
+ Style/DoubleCopDisableDirective:
390
+ Enabled: false
391
+ Style/EmptyBlockParameter:
392
+ Enabled: false
393
+ Style/EmptyLambdaParameter:
394
+ Enabled: false
395
+ Style/Encoding:
396
+ Enabled: false
397
+ Style/EvalWithLocation:
398
+ Enabled: false
399
+ Style/ExpandPathArguments:
400
+ Enabled: false
401
+ Style/ExplicitBlockArgument:
402
+ Enabled: false
403
+ Style/ExponentialNotation:
404
+ Enabled: false
405
+ Style/FetchEnvVar:
406
+ Enabled: false
407
+ Style/FloatDivision:
408
+ Enabled: false
409
+ Style/FrozenStringLiteralComment:
410
+ Enabled: false
411
+ Style/GlobalStdStream:
412
+ Enabled: false
413
+ Style/HashAsLastArrayItem:
414
+ Enabled: false
415
+ Style/HashLikeCase:
416
+ Enabled: false
417
+ Style/HashTransformKeys:
418
+ Enabled: false
419
+ Style/HashTransformValues:
420
+ Enabled: false
421
+ Style/IfUnlessModifier:
422
+ Enabled: false
423
+ Style/IfWithBooleanLiteralBranches:
424
+ Enabled: false
425
+ Style/KeywordParametersOrder:
426
+ Enabled: false
427
+ Style/MinMax:
428
+ Enabled: false
429
+ Style/MixinUsage:
430
+ Enabled: false
431
+ Style/MultilineWhenThen:
432
+ Enabled: false
433
+ Style/NegatedUnless:
434
+ Enabled: false
435
+ Style/NumericPredicate:
436
+ Enabled: false
437
+ Style/OptionalBooleanParameter:
438
+ Enabled: false
439
+ Style/OrAssignment:
440
+ Enabled: false
441
+ Style/QuotedSymbols:
442
+ Enabled: false
443
+ Style/RandomWithOffset:
444
+ Enabled: false
445
+ Style/RedundantAssignment:
446
+ Enabled: false
447
+ Style/RedundantCondition:
448
+ Enabled: false
449
+ Style/RedundantConditional:
450
+ Enabled: false
451
+ Style/RedundantFetchBlock:
452
+ Enabled: false
453
+ Style/RedundantFileExtensionInRequire:
454
+ Enabled: false
455
+ Style/RedundantRegexpCharacterClass:
456
+ Enabled: false
457
+ Style/RedundantRegexpEscape:
458
+ Enabled: false
459
+ Style/RedundantSelfAssignment:
460
+ Enabled: false
461
+ Style/RedundantSort:
462
+ Enabled: false
463
+ Style/RescueStandardError:
464
+ Enabled: false
465
+ Style/RedundantConstantBase:
466
+ Enabled: false
467
+ Style/RedundantStringEscape:
468
+ Enabled: false
469
+ Style/SelectByRegexp:
470
+ Enabled: false
471
+ Style/SingleArgumentDig:
472
+ Enabled: false
473
+ Style/SlicingWithRange:
474
+ Enabled: false
475
+ Style/SoleNestedConditional:
476
+ Enabled: false
477
+ Style/StderrPuts:
478
+ Enabled: false
479
+ Style/StringConcatenation:
480
+ Enabled: false
481
+ Style/Strip:
482
+ Enabled: false
483
+ Style/SymbolProc:
484
+ Enabled: false
485
+ Style/TrailingBodyOnClass:
486
+ Enabled: false
487
+ Style/TrailingBodyOnMethodDefinition:
488
+ Enabled: false
489
+ Style/TrailingBodyOnModule:
490
+ Enabled: false
491
+ Style/TrailingCommaInHashLiteral:
492
+ Enabled: false
493
+ Style/TrailingMethodEndStatement:
494
+ Enabled: false
495
+ Style/UnpackFirst:
496
+ Enabled: false
497
+ Lint/DuplicateBranch:
498
+ Enabled: false
499
+ Lint/DuplicateRegexpCharacterClassElement:
500
+ Enabled: false
501
+ Lint/EmptyBlock:
502
+ Enabled: false
503
+ Lint/EmptyClass:
504
+ Enabled: false
505
+ Lint/NoReturnInBeginEndBlocks:
506
+ Enabled: false
507
+ Lint/ToEnumArguments:
508
+ Enabled: false
509
+ Lint/UnexpectedBlockArity:
510
+ Enabled: false
511
+ Lint/UnmodifiedReduceAccumulator:
512
+ Enabled: false
513
+ Performance/CollectionLiteralInLoop:
514
+ Enabled: false
515
+ Style/ArgumentsForwarding:
516
+ Enabled: false
517
+ Style/CollectionCompact:
518
+ Enabled: false
519
+ Style/DocumentDynamicEvalDefinition:
520
+ Enabled: false
521
+ Style/NegatedIfElseCondition:
522
+ Enabled: false
523
+ Style/NilLambda:
524
+ Enabled: false
525
+ Style/RedundantArgument:
526
+ Enabled: false
527
+ Style/SwapValues:
528
+ Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cem_acpt (0.6.2)
4
+ cem_acpt (0.6.4)
5
5
  async-http (>= 0.60, < 0.70)
6
6
  bcrypt_pbkdf (>= 1.0, < 2.0)
7
7
  deep_merge (>= 1.2, < 2.0)
@@ -20,6 +20,7 @@ module CemAcpt
20
20
  log_format
21
21
  module_dir
22
22
  node_data
23
+ no_destroy_nodes
23
24
  no_ephemeral_ssh_key
24
25
  platform
25
26
  provisioner
@@ -32,7 +32,7 @@ module CemAcpt
32
32
  CemAcpt::Logging::Logger.new(config[:logdev],
33
33
  config[:shift_age],
34
34
  config[:shift_size],
35
- **config.except(:logdev, :shift_age, :shift_size))
35
+ **config.reject { |k, _| [:logdev, :shift_age, :shift_size].include?(k) })
36
36
  end
37
37
  new(*loggers)
38
38
  end
@@ -26,7 +26,7 @@ module CemAcpt::Platform
26
26
 
27
27
  logger.info "Using #{platform} for #{run_data[:test_data].length} tests..."
28
28
  run_data[:test_data].dup.each_with_object([]) do |single_test_data, ary|
29
- ary << new_platform_object(platform, config, single_test_data, **run_data.except(:test_data))
29
+ ary << new_platform_object(platform, config, single_test_data, **run_data.reject { |k, _| k == :test_data })
30
30
  end
31
31
  end
32
32
 
@@ -11,7 +11,7 @@ module CemAcpt
11
11
  end
12
12
 
13
13
  def self.valid_versions
14
- %w[7, 8]
14
+ %w[7 8]
15
15
  end
16
16
 
17
17
  def systemd_files
@@ -11,6 +11,7 @@ module CemAcpt
11
11
  module Provision
12
12
  class Terraform
13
13
  DEFAULT_PLAN_NAME = 'testplan.tfplan'
14
+ DEFAULT_VARS_FILE = 'testvars.json'
14
15
  include CemAcpt::Logging
15
16
 
16
17
  attr_reader :environment, :working_dir
@@ -27,6 +28,7 @@ module CemAcpt
27
28
  logger.info('Terraform') { 'Provisioning nodes...' }
28
29
  @working_dir = new_working_dir
29
30
  validate_working_dir!
31
+ save_vars_to_file!(formatted_vars) # Easier to reuse nodes this way
30
32
 
31
33
  terraform_configure_logging
32
34
  terraform_init
@@ -42,6 +44,10 @@ module CemAcpt
42
44
  @working_dir = nil
43
45
  end
44
46
 
47
+ def show
48
+ terraform_show
49
+ end
50
+
45
51
  private
46
52
 
47
53
  def terraform
@@ -104,6 +110,11 @@ module CemAcpt
104
110
  )
105
111
  end
106
112
 
113
+ def terraform_show
114
+ logger.debug('Terraform') { 'Showing Terraform state' }
115
+ terraform.show({ chdir: working_dir, no_color: true }, { environment: environment })
116
+ end
117
+
107
118
  def new_backend(test_name)
108
119
  if CemAcpt::Provision::Linux.use_for?(test_name)
109
120
  logger.info('Terraform') { 'Using Linux backend' }
@@ -164,6 +175,14 @@ module CemAcpt
164
175
  raise e
165
176
  end
166
177
 
178
+ def save_vars_to_file!(vars)
179
+ logger.debug('Terraform') { "Saving vars to file #{File.join(working_dir, DEFAULT_VARS_FILE)}" }
180
+ File.write(File.join(working_dir, DEFAULT_VARS_FILE), vars.to_json)
181
+ rescue StandardError => e
182
+ logger.error('Terraform') { 'Error saving vars to file' }
183
+ raise e
184
+ end
185
+
167
186
  def provision_node_data
168
187
  node_data = @provision_data[:nodes].each_with_object({}) do |node, h|
169
188
  h[node.node_name] = node.node_data.merge(
@@ -69,6 +69,8 @@ module CemAcpt
69
69
  def clean_up(trap_context = false)
70
70
  kill_keep_terminal_alive unless trap_context
71
71
 
72
+ return no_destroy if config.get('no_destroy_nodes')
73
+
72
74
  clean_ephemeral_ssh_keys
73
75
  destroy_test_nodes
74
76
  end
@@ -122,7 +124,13 @@ module CemAcpt
122
124
  end
123
125
 
124
126
  def destroy_test_nodes
125
- @provisioner&.destroy
127
+ @provisioner&.destroy if config.get('no_destroy_nodes')
128
+ end
129
+
130
+ def no_destroy
131
+ logger.warn('CemAcpt') { 'Not destroying test nodes...' }
132
+ @provisioner&.show
133
+ logger.info('CemAcpt') { "Test SSH Keys:\n Private Key: #{@run_data[:private_key]}\n Public Key:#{@run_data[:public_key]}" }
126
134
  end
127
135
 
128
136
  def run_tests(hosts, only_actions, except_actions)
@@ -160,7 +160,7 @@ module CemAcpt
160
160
  type: 'ed25519',
161
161
  bits: '4096',
162
162
  rounds: '100',
163
- comment: 'Ephemeral for cem_acpt',
163
+ comment: 'cem_acpt-ephemeral',
164
164
  password: '',
165
165
  known_hosts: 'acpt_known_hosts',
166
166
  overwrite_known_hosts: true,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CemAcpt
4
- VERSION = '0.6.2'
4
+ VERSION = '0.6.4'
5
5
  end
@@ -99,6 +99,7 @@ resource "google_compute_instance" "acpt-test-node" {
99
99
  user = "${var.username}"
100
100
  timeout = "5m"
101
101
  host = self.network_interface.0.access_config.0.nat_ip
102
+ port = 22
102
103
  private_key = "${file(var.private_key)}"
103
104
  agent = false
104
105
  }
@@ -116,6 +117,7 @@ resource "google_compute_instance" "acpt-test-node" {
116
117
  user = "${var.username}"
117
118
  timeout = "2m"
118
119
  host = self.network_interface.0.access_config.0.nat_ip
120
+ port = 22
119
121
  private_key = "${file(var.private_key)}"
120
122
  agent = false
121
123
  }
@@ -129,6 +131,7 @@ resource "google_compute_instance" "acpt-test-node" {
129
131
  user = "${var.username}"
130
132
  timeout = "2m"
131
133
  host = self.network_interface.0.access_config.0.nat_ip
134
+ port = 22
132
135
  private_key = "${file(var.private_key)}"
133
136
  agent = false
134
137
  }
@@ -142,6 +145,7 @@ resource "google_compute_instance" "acpt-test-node" {
142
145
  user = "${var.username}"
143
146
  timeout = "2m"
144
147
  host = self.network_interface.0.access_config.0.nat_ip
148
+ port = 22
145
149
  private_key = "${file(var.private_key)}"
146
150
  agent = false
147
151
  }
@@ -155,6 +159,7 @@ resource "google_compute_instance" "acpt-test-node" {
155
159
  user = "${var.username}"
156
160
  timeout = "2m"
157
161
  host = self.network_interface.0.access_config.0.nat_ip
162
+ port = 22
158
163
  private_key = "${file(var.private_key)}"
159
164
  agent = false
160
165
  }
@@ -166,6 +171,7 @@ resource "google_compute_instance" "acpt-test-node" {
166
171
  user = "${var.username}"
167
172
  timeout = "5m"
168
173
  host = self.network_interface.0.access_config.0.nat_ip
174
+ port = 22
169
175
  private_key = "${file(var.private_key)}"
170
176
  agent = false
171
177
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cem_acpt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - puppetlabs
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-24 00:00:00.000000000 Z
11
+ date: 2023-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http
@@ -157,6 +157,7 @@ files:
157
157
  - ".github/workflows/spec.yml"
158
158
  - ".gitignore"
159
159
  - ".rspec"
160
+ - ".rubocop.yml"
160
161
  - CODEOWNERS
161
162
  - Gemfile
162
163
  - Gemfile.lock