kitchen-terraform 5.6.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/README.md +19 -19
  5. data/lib/kitchen/driver/terraform.rb +1 -1
  6. data/lib/kitchen/provisioner/terraform.rb +1 -1
  7. data/lib/kitchen/terraform.rb +1 -1
  8. data/lib/kitchen/terraform/breaking.rb +1 -1
  9. data/lib/kitchen/terraform/command.rb +1 -1
  10. data/lib/kitchen/terraform/command/apply.rb +1 -1
  11. data/lib/kitchen/terraform/command/destroy.rb +1 -1
  12. data/lib/kitchen/terraform/command/get.rb +1 -1
  13. data/lib/kitchen/terraform/command/init.rb +3 -80
  14. data/lib/kitchen/terraform/command/init/post_zero_fifteen_zero.rb +89 -0
  15. data/lib/kitchen/terraform/command/init/pre_zero_fifteen_zero.rb +101 -0
  16. data/lib/kitchen/terraform/command/init_factory.rb +52 -0
  17. data/lib/kitchen/terraform/command/output.rb +1 -1
  18. data/lib/kitchen/terraform/command/validate.rb +3 -41
  19. data/lib/kitchen/terraform/command/validate/post_zero_fifteen_zero.rb +51 -0
  20. data/lib/kitchen/terraform/command/validate/pre_zero_fifteen_zero.rb +65 -0
  21. data/lib/kitchen/terraform/command/validate_factory.rb +54 -0
  22. data/lib/kitchen/terraform/command/version.rb +1 -1
  23. data/lib/kitchen/terraform/command/workspace_delete.rb +1 -1
  24. data/lib/kitchen/terraform/command/workspace_new.rb +1 -1
  25. data/lib/kitchen/terraform/command/workspace_select.rb +1 -1
  26. data/lib/kitchen/terraform/command_executor.rb +3 -5
  27. data/lib/kitchen/terraform/command_flag.rb +1 -1
  28. data/lib/kitchen/terraform/command_flag/backend_config.rb +1 -1
  29. data/lib/kitchen/terraform/command_flag/color.rb +1 -1
  30. data/lib/kitchen/terraform/command_flag/lock_timeout.rb +1 -1
  31. data/lib/kitchen/terraform/command_flag/plugin_dir.rb +1 -1
  32. data/lib/kitchen/terraform/command_flag/upgrade.rb +2 -2
  33. data/lib/kitchen/terraform/command_flag/var.rb +1 -1
  34. data/lib/kitchen/terraform/command_flag/var_file.rb +1 -1
  35. data/lib/kitchen/terraform/config_attribute.rb +1 -1
  36. data/lib/kitchen/terraform/config_attribute/backend_configurations.rb +1 -1
  37. data/lib/kitchen/terraform/config_attribute/client.rb +3 -3
  38. data/lib/kitchen/terraform/config_attribute/color.rb +3 -3
  39. data/lib/kitchen/terraform/config_attribute/command_timeout.rb +1 -1
  40. data/lib/kitchen/terraform/config_attribute/fail_fast.rb +3 -3
  41. data/lib/kitchen/terraform/config_attribute/lock.rb +3 -3
  42. data/lib/kitchen/terraform/config_attribute/lock_timeout.rb +1 -1
  43. data/lib/kitchen/terraform/config_attribute/parallelism.rb +1 -1
  44. data/lib/kitchen/terraform/config_attribute/plugin_directory.rb +3 -3
  45. data/lib/kitchen/terraform/config_attribute/root_module_directory.rb +3 -3
  46. data/lib/kitchen/terraform/config_attribute/systems.rb +552 -4
  47. data/lib/kitchen/terraform/config_attribute/variable_files.rb +3 -3
  48. data/lib/kitchen/terraform/config_attribute/variables.rb +1 -1
  49. data/lib/kitchen/terraform/config_attribute/verify_version.rb +3 -3
  50. data/lib/kitchen/terraform/config_attribute_cacher.rb +1 -1
  51. data/lib/kitchen/terraform/{config_predicates.rb → config_attribute_contract.rb} +3 -3
  52. data/lib/kitchen/terraform/config_attribute_contract/array_of_strings.rb +30 -0
  53. data/lib/kitchen/terraform/{config_schemas → config_attribute_contract}/boolean.rb +7 -11
  54. data/lib/kitchen/terraform/config_attribute_contract/hash_of_symbols_and_strings.rb +41 -0
  55. data/lib/kitchen/terraform/{config_schemas.rb → config_attribute_contract/integer.rb} +10 -3
  56. data/lib/kitchen/terraform/config_attribute_contract/optional_string.rb +30 -0
  57. data/lib/kitchen/terraform/{config_schemas → config_attribute_contract}/string.rb +7 -9
  58. data/lib/kitchen/terraform/config_attribute_contract/systems.rb +63 -0
  59. data/lib/kitchen/terraform/config_attribute_definer.rb +2 -2
  60. data/lib/kitchen/terraform/config_attribute_type.rb +1 -1
  61. data/lib/kitchen/terraform/config_attribute_type/hash_of_symbols_and_strings.rb +9 -16
  62. data/lib/kitchen/terraform/config_attribute_type/integer.rb +27 -23
  63. data/lib/kitchen/terraform/configurable.rb +2 -2
  64. data/lib/kitchen/terraform/debug_logger.rb +1 -1
  65. data/lib/kitchen/terraform/deprecating.rb +1 -1
  66. data/lib/kitchen/terraform/driver.rb +1 -1
  67. data/lib/kitchen/terraform/driver/create.rb +39 -16
  68. data/lib/kitchen/terraform/driver/destroy.rb +53 -21
  69. data/lib/kitchen/terraform/error.rb +1 -1
  70. data/lib/kitchen/terraform/file_path_config_attribute_definer.rb +1 -1
  71. data/lib/kitchen/terraform/inspec.rb +1 -1
  72. data/lib/kitchen/terraform/inspec/fail_fast_with_hosts.rb +1 -1
  73. data/lib/kitchen/terraform/inspec/fail_slow_with_hosts.rb +1 -1
  74. data/lib/kitchen/terraform/inspec/without_hosts.rb +1 -1
  75. data/lib/kitchen/terraform/inspec_factory.rb +1 -1
  76. data/lib/kitchen/terraform/inspec_options_factory.rb +1 -1
  77. data/lib/kitchen/terraform/inspec_runner.rb +8 -1
  78. data/lib/kitchen/terraform/outputs_manager.rb +1 -1
  79. data/lib/kitchen/terraform/outputs_parser.rb +1 -1
  80. data/lib/kitchen/terraform/outputs_reader.rb +2 -2
  81. data/lib/kitchen/terraform/provisioner.rb +1 -1
  82. data/lib/kitchen/terraform/provisioner/converge.rb +52 -25
  83. data/lib/kitchen/terraform/raise.rb +1 -1
  84. data/lib/kitchen/terraform/raise/action_failed.rb +1 -1
  85. data/lib/kitchen/terraform/raise/client_error.rb +1 -1
  86. data/lib/kitchen/terraform/shell_out.rb +6 -5
  87. data/lib/kitchen/terraform/system.rb +1 -1
  88. data/lib/kitchen/terraform/system_attrs_inputs_resolver.rb +1 -1
  89. data/lib/kitchen/terraform/system_attrs_outputs_resolver.rb +1 -1
  90. data/lib/kitchen/terraform/system_bastion_host_resolver.rb +1 -1
  91. data/lib/kitchen/terraform/system_hosts_resolver.rb +1 -1
  92. data/lib/kitchen/terraform/system_inspec_map.rb +1 -1
  93. data/lib/kitchen/terraform/systems_verifier.rb +1 -1
  94. data/lib/kitchen/terraform/systems_verifier/fail_fast.rb +1 -1
  95. data/lib/kitchen/terraform/systems_verifier/fail_slow.rb +1 -1
  96. data/lib/kitchen/terraform/systems_verifier_factory.rb +1 -1
  97. data/lib/kitchen/terraform/unsupported_client_version_error.rb +1 -1
  98. data/lib/kitchen/terraform/variables_manager.rb +1 -1
  99. data/lib/kitchen/terraform/verify_version.rb +5 -17
  100. data/lib/kitchen/terraform/verify_version_rescue_strategy.rb +1 -1
  101. data/lib/kitchen/terraform/verify_version_rescue_strategy/permissive.rb +1 -1
  102. data/lib/kitchen/terraform/verify_version_rescue_strategy/strict.rb +1 -1
  103. data/lib/kitchen/terraform/verify_version_rescue_strategy_factory.rb +1 -1
  104. data/lib/kitchen/terraform/version.rb +2 -2
  105. data/lib/kitchen/terraform/version_verifier.rb +1 -1
  106. data/lib/kitchen/terraform/version_verifier_strategy.rb +1 -1
  107. data/lib/kitchen/terraform/version_verifier_strategy/supported.rb +1 -1
  108. data/lib/kitchen/terraform/version_verifier_strategy/unsupported.rb +1 -1
  109. data/lib/kitchen/terraform/version_verifier_strategy_factory.rb +1 -1
  110. data/lib/kitchen/verifier/terraform.rb +1 -1
  111. metadata +88 -53
  112. metadata.gz.sig +0 -0
  113. data/lib/kitchen/terraform/config_predicates/hash_of_symbols_and_strings.rb +0 -81
  114. data/lib/kitchen/terraform/config_schemas/array_of_strings.rb +0 -38
  115. data/lib/kitchen/terraform/config_schemas/optional_string.rb +0 -38
  116. data/lib/kitchen/terraform/config_schemas/system.rb +0 -609
  117. data/lib/kitchen/terraform/config_schemas/systems.rb +0 -37
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2016-2019 New Context, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- require "dry/validation"
18
-
19
- module Kitchen
20
- module Terraform
21
- module ConfigSchemas
22
- # A validation schema for a configuration attribute which is an array including only strings.
23
- #
24
- # @see http://dry-rb.org/gems/dry-validation/basics/working-with-schemas/ DRY Validation Working With Schemas
25
- ArrayOfStrings = ::Dry::Validation.Schema do
26
- required(:value)
27
- .each(
28
- :filled?,
29
- :str?
30
- )
31
- end.dup
32
-
33
- ArrayOfStrings.define_singleton_method :to_s do
34
- "Kitchen::Terraform::ConfigSchemas::ArrayOfStrings"
35
- end
36
- end
37
- end
38
- end
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2016-2019 New Context, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- require "dry/validation"
18
-
19
- module Kitchen
20
- module Terraform
21
- module ConfigSchemas
22
- # A validation schema for a configuration attribute which is an optional string.
23
- #
24
- # @see http://dry-rb.org/gems/dry-validation/basics/working-with-schemas/ DRY Validation Working With Schemas
25
- OptionalString = ::Dry::Validation.Schema do
26
- required(:value)
27
- .maybe(
28
- :str?,
29
- :filled?
30
- )
31
- end.dup
32
-
33
- OptionalString.define_singleton_method :to_s do
34
- "Kitchen::Terraform::ConfigSchemas::OptionalString"
35
- end
36
- end
37
- end
38
- end
@@ -1,609 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2016-2019 New Context, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- require "dry/validation"
18
-
19
- module Kitchen
20
- module Terraform
21
- module ConfigSchemas
22
- # A system is a mapping which is used to configure the execution of {https://www.inspec.io/docs/ InSpec tests}
23
- # against a system in the Terraform state. The keys of a system mapping correlate to the arguments and the
24
- # options of the {https://www.inspec.io/docs/reference/cli/#exec +inspec exec+} command-line interface
25
- # subcomamand.
26
- #
27
- # ===== InSpec Profiles
28
- #
29
- # All systems within the same {https://kitchen.ci/docs/getting-started/adding-suite Kitchen suite} are by default
30
- # tested using the same {https://www.inspec.io/docs/reference/profiles/ InSpec profile}. The profile must be
31
- # implemented in the directory located at `<Kitchen root>/test/integration/<suite name>`. This behaviour can be
32
- # overridden with the <code>profile_locations</code> key.
33
- #
34
- # The values of any {https://www.terraform.io/docs/configuration/variables.html Terraform variables} configured
35
- # with the driver's <code>variables</code> attribute and the values of any
36
- # {https://www.terraform.io/docs/configuration/outputs.html Terraform outputs} which exist in the Terraform state
37
- # are associated with equivalently named
38
- # {https://www.inspec.io/docs/reference/profiles/#profile-attributes InSpec profile attributes}, prefixed with
39
- # <code>input_</code> or <code>output_</code>, respectively. The values of the outputs are also associated with
40
- # equivalently named profile attributes without any prefixes for backward compatibility. Output associations can
41
- # be overridden with the <code>attrs_outputs</code> key. For example, the value of a variable named `test` will
42
- # be associated with an attribute named `input_test`, and the value of an output named `test` will be associated
43
- # with an attribute named `output_test` as well as an attribute named `test`.
44
- #
45
- # ===== Required Keys
46
- #
47
- # The following keys must be included by every system.
48
- #
49
- # ====== name
50
- #
51
- # The value of the +name+ key is a scalar which is used to refer to the system for logging purposes.
52
- #
53
- # <em>Example kitchen.yml</em>
54
- # verifier:
55
- # name: terraform
56
- # systems:
57
- # - name: a system
58
- # backend: local
59
- #
60
- # ====== backend
61
- #
62
- # The value of the +backend+ key is a scalar which is used to select the
63
- # {https://www.inspec.io/docs/reference/cli/#exec InSpec backend} for connections to the system.
64
- #
65
- # The scalar must match the name of one the available backends.
66
- #
67
- # <em>Example kitchen.yml</em>
68
- # verifier:
69
- # name: terraform
70
- # systems:
71
- # - name: a system
72
- # backend: docker
73
- #
74
- # ===== Optional Keys
75
- #
76
- # The following keys may be included by any system to alter the behaviour of InSpec. Any key which is omitted
77
- # will be associated with a default value as defined by InSpec except where otherwise noted.
78
- #
79
- # ====== attrs
80
- #
81
- # The value of the +attrs+ key is a sequence of scalars which is used to locate any
82
- # {https://www.inspec.io/docs/reference/profiles/#profile-attributes InSpec profile attributes} files.
83
- #
84
- # <em>Example kitchen.yml</em>
85
- # verifier:
86
- # name: terraform
87
- # systems:
88
- # - name: a system
89
- # backend: local
90
- # attrs:
91
- # - /path/to/first_attributes.yml
92
- # - /path/to/second_attributes.yml
93
- #
94
- # ====== attrs_outputs
95
- #
96
- # The value of the +attrs_outputs+ key is a mapping of scalars to scalars which is used to define
97
- # {https://www.inspec.io/docs/reference/profiles/#profile-attributes InSpec profile attributes} with the values
98
- # of Terraform outputs.
99
- #
100
- # The use of the +attrs_outputs+ key is only necessary to override the default definitions of profile attributes
101
- # with names and values equivalent to the outputs.
102
- #
103
- # <em>Example kitchen.yml</em>
104
- # verifier:
105
- # name: terraform
106
- # systems:
107
- # - name: a system
108
- # backend: local
109
- # attrs_outputs:
110
- # an_attribute_name: an_output_name
111
- #
112
- # ====== backend_cache
113
- #
114
- # The value of the +backend_cache+ key is a boolean which is used to toggle the caching of InSpec backend command
115
- # output.
116
- #
117
- # <em>Example kitchen.yml</em>
118
- # verifier:
119
- # name: terraform
120
- # systems:
121
- # - name: a system
122
- # backend: local
123
- # backend_cache: false
124
- #
125
- # ====== bastion_host
126
- #
127
- # The value of the +bastion_host+ key is a scalar which is used as the hostname of a
128
- # {https://en.wikipedia.org/wiki/Bastion_host bastion host} to connect to before connecting to hosts in the
129
- # system.
130
- #
131
- # The +bastion_host+ key must be used in combination with a backend which supports remote connections.
132
- #
133
- # The +bastion_host_output+ key will take priority over the +bastion_host+ key.
134
- #
135
- # <em>Example kitchen.yml</em>
136
- # verifier:
137
- # name: terraform
138
- # systems:
139
- # - name: a system
140
- # backend: ssh
141
- # bastion_host: bastion-host.domain
142
- #
143
- # ====== bastion_host_output
144
- #
145
- # The value of the +bastion_host_output+ key is a scalar which is used to obtain the address of a bastion host in
146
- # the system from a Terraform output.
147
- #
148
- # The scalar must match the name of an output with a value which is a string.
149
- #
150
- # The +bastion_host_output+ key must be used in combination with a backend which enables remote connections.
151
- #
152
- # <em>Example kitchen.yml</em>
153
- # verifier:
154
- # name: terraform
155
- # systems:
156
- # - name: a system
157
- # backend: ssh
158
- # bastion_host_output: an_output
159
- #
160
- # ====== bastion_port
161
- #
162
- # The value of the +bastion_port+ key is an integer which is used as the port number to connect to on the bastion
163
- # host.
164
- #
165
- # The +bastion_port+ key must be used in combination with the +bastion_host_output+ key or the +bastion_host+ key.
166
- #
167
- # <em>Example kitchen.yml</em>
168
- # verifier:
169
- # name: terraform
170
- # systems:
171
- # - name: a system
172
- # backend: ssh
173
- # bastion_host_output: an_output
174
- # bastion_port: 1234
175
- #
176
- # ====== bastion_user
177
- #
178
- # The value of the +bastion_user+ key is a scalar which is used as the username for authentication with the
179
- # bastion host.
180
- #
181
- # The +bastion_user+ key must be used in combination with the +bastion_host_output+ key or the +bastion_host+ key.
182
- #
183
- # <em>Example kitchen.yml</em>
184
- # verifier:
185
- # name: terraform
186
- # systems:
187
- # - name: a system
188
- # backend: ssh
189
- # bastion_host_output: an_output
190
- # bastion_user: bastion-user
191
- #
192
- # ====== controls
193
- #
194
- # The value of the +controls+ key is a sequence of scalars which is used to select for execution against the
195
- # system a subset of the {https://www.inspec.io/docs/reference/dsl_inspec/ InSpec controls} of the profile.
196
- #
197
- # The use of the +controls+ key is only necessary if the system should not be tested with all of the controls of # the profile.
198
- #
199
- # The scalars must match the names of the controls, not the names of the control files.
200
- #
201
- # <em>Example kitchen.yml</em>
202
- # verifier:
203
- # name: terraform
204
- # systems:
205
- # - name: first system
206
- # backend: local
207
- # controls:
208
- # - first control
209
- # - third control
210
- # - name: second system
211
- # backend: local
212
- # controls:
213
- # - second control
214
- # - fourth control
215
- #
216
- # ====== enable_password
217
- #
218
- # The value of the +enable_password+ key is a scalar which is used as the password for authentication with a
219
- # Cisco IOS device in enable mode.
220
- #
221
- # The +enable_password+ key must be used in combination with <tt>backend: ssh</tt>.
222
- #
223
- # <em>Example kitchen.yml</em>
224
- # verifier:
225
- # name: terraform
226
- # systems:
227
- # - name: a system
228
- # backend: ssh
229
- # enable_password: Cisc0!
230
- #
231
- # ====== hosts
232
- #
233
- # The value of the +hosts+ key is a sequence of scalars which is used as addresses of hosts in the system.
234
- #
235
- # The +hosts+ key must be used in combination with a backend which enables remote connections.
236
- #
237
- # <em>Example kitchen.yml</em>
238
- # verifier:
239
- # name: terraform
240
- # systems:
241
- # - name: a system
242
- # backend: ssh
243
- # hosts:
244
- # - hostname.domainname
245
- #
246
- # ====== hosts_output
247
- #
248
- # The value of the +hosts_output+ key is a scalar which is used to obtain the addresses of hosts in the system
249
- # from a Terraform output.
250
- #
251
- # The scalar must match the name of an output with a value which is a string or an array of strings.
252
- #
253
- # The +hosts_output+ key must be used in combination with a backend which enables remote connections.
254
- #
255
- # <em>Example kitchen.yml</em>
256
- # verifier:
257
- # name: terraform
258
- # systems:
259
- # - name: a system
260
- # backend: ssh
261
- # hosts_output: an_output
262
- #
263
- # ====== key_files
264
- #
265
- # The value of the +key_files+ key is a sequence of scalars which is used to locate key files (also known as
266
- # identity files) for {https://linux.die.net/man/1/ssh Secure Shell (SSH) authentication} with hosts in the
267
- # Terraform state.
268
- #
269
- # The +key_files+ key must be used in combination with <tt>backend: ssh</tt>.
270
- #
271
- # <em>Example kitchen.yml</em>
272
- # verifier:
273
- # name: terraform
274
- # systems:
275
- # - name: a system
276
- # backend: ssh
277
- # key_files:
278
- # - /path/to/first/key/file
279
- # - /path/to/second/key/file
280
- #
281
- # ====== password
282
- #
283
- # The value of the +password+ key is a scalar which is used as the password for authentication with hosts in the
284
- # system.
285
- #
286
- # The +password+ key must be used in combination with a backend which supports password authentication.
287
- #
288
- # <em>Example kitchen.yml</em>
289
- # verifier:
290
- # name: terraform
291
- # systems:
292
- # - name: a system
293
- # backend: ssh
294
- # password: Th3P455I5Th3W0rd
295
- #
296
- # ====== path
297
- #
298
- # The value of the +path+ key is a scalar which is used as the login path when connecting to a host in the system.
299
- #
300
- # The +path+ key must be used in combination with <tt>backend: winrm</tt>.
301
- #
302
- # <em>Example kitchen.yml</em>
303
- # verifier:
304
- # name: terraform
305
- # systems:
306
- # - name: a system
307
- # backend: winrm
308
- # path: /login
309
- #
310
- # ====== port
311
- #
312
- # The value of the +port+ key is an integer which is used as the port number when connecting via SSH to the hosts
313
- # of the system.
314
- #
315
- # The +port+ key must be used in combination with <tt>backend: ssh</tt>.
316
- #
317
- # If the +port+ key is omitted then the value of the +port+ key of the Test Kitchen transport will be used.
318
- #
319
- # <em>Example kitchen.yml</em>
320
- # verifier:
321
- # name: terraform
322
- # systems:
323
- # - name: a system
324
- # backend: ssh
325
- # port: 1234
326
- #
327
- # ====== profile_locations
328
- #
329
- # The value of the <code>profile_locations</code> key is a sequence of scalars which is used to locate
330
- # {https://www.inspec.io/docs/reference/profiles/ InSpec profiles} containing the controls to be executed against
331
- # the system. This key corresponds to the LOCATIONS argument of <code>inspec exec</code>.
332
- #
333
- # The default value contains a single scalar which assumes that a profile exists locally for the associated
334
- # {https://kitchen.ci/docs/getting-started/adding-suite Kitchen suite} at
335
- # <code><KITCHEN ROOT>/test/integration/<KITCHEN SUITE NAME></code>.
336
- #
337
- # <em>Example kitchen.yml</em>
338
- # verifier:
339
- # name: terraform
340
- # systems:
341
- # - name: a system
342
- # backend: local
343
- # profile_locations:
344
- # - supermarket://username/linux-baseline
345
- # - /path/to/profile
346
- # - /path/to/a_test.rb
347
- #
348
- # ====== proxy_command
349
- #
350
- # The value of the +proxy_command+ key is a scalar which is used as a proxy command when connecting to a host via
351
- # SSH.
352
- #
353
- # The +proxy_command+ key must be used in combination with <tt>backend: ssh</tt>.
354
- #
355
- # <em>Example kitchen.yml</em>
356
- # verifier:
357
- # name: terraform
358
- # systems:
359
- # - name: a system
360
- # backend: ssh
361
- # proxy_command: ssh root@127.0.0.1 -W %h:%p
362
- #
363
- # ====== reporter
364
- #
365
- # The value of the +reporter+ key is a sequence of scalars which is used to select the
366
- # {https://www.inspec.io/docs/reference/reporters/#supported-reporters InSpec reporters}
367
- # for reporting test output.
368
- #
369
- # The scalars must match the names of the available reporters.
370
- #
371
- # <em>Example kitchen.yml</em>
372
- # verifier:
373
- # name: terraform
374
- # systems:
375
- # - name: a system
376
- # backend: local
377
- # reporter:
378
- # - cli
379
- # - documentation
380
- #
381
- # ====== self_signed
382
- #
383
- # The value of the +self_signed+ key is a boolean which is used to toggle permission for self-signed certificates
384
- # during testing of Windows hosts.
385
- #
386
- # The +self_signed+ key must be used in combination with <tt>backend: winrm</tt>.
387
- #
388
- # <em>Example kitchen.yml</em>
389
- # verifier:
390
- # name: terraform
391
- # systems:
392
- # - name: a system
393
- # backend: winrm
394
- # self_signed: true
395
- #
396
- # ====== shell
397
- #
398
- # The value of the +shell+ key is a boolean which is used to toggle the use of a subshell when executing tests on
399
- # hosts in the system.
400
- #
401
- # The +shell+ key is only effective for a system which has Unix-like hosts.
402
- #
403
- # <em>Example kitchen.yml</em>
404
- # verifier:
405
- # name: terraform
406
- # systems:
407
- # - name: a system
408
- # backend: ssh
409
- # hosts_output: an_output
410
- # shell: true
411
- #
412
- # ====== shell_command
413
- #
414
- # The value of the +shell_command+ key is a scalar which is used to override the default shell command used to
415
- # instantiate a subshell.
416
- #
417
- # The +shell_command+ key must be used in combination with <tt>shell: true</tt>.
418
- #
419
- # <em>Example kitchen.yml</em>
420
- # verifier:
421
- # name: terraform
422
- # systems:
423
- # - name: a system
424
- # backend: ssh
425
- # hosts_output: an_output
426
- # shell: true
427
- # shell_command: /bin/ksh
428
- #
429
- # ====== shell_options
430
- #
431
- # The value of the +shell_options+ key is a scalar which is used to provide options to the subshell.
432
- #
433
- # The +shell_options+ key must be used in combination with <tt>shell: true</tt>.
434
- #
435
- # <em>Example kitchen.yml</em>
436
- # verifier:
437
- # name: terraform
438
- # systems:
439
- # - name: a system
440
- # backend: ssh
441
- # hosts_output: an_output
442
- # shell: true
443
- # shell_options: -v
444
- #
445
- # ====== show_progress
446
- #
447
- # The value of the +show_progress+ key is a boolean which is used to toggle the display of progress while tests
448
- # are executing.
449
- #
450
- # <em>Example kitchen.yml</em>
451
- # verifier:
452
- # name: terraform
453
- # systems:
454
- # - name: a system
455
- # backend: local
456
- # show_progress: false
457
- #
458
- # ====== ssl
459
- #
460
- # The value of the +ssl+ key is a boolean which is used to toggle the use of
461
- # {https://en.wikipedia.org/wiki/Transport_Layer_Security Transport Layer Security (TLS)} when connecting to
462
- # hosts in the system. InSpec's reference to Secure Socket Layer (SSL) is a misnomer as that protocol has been
463
- # deprecated in favour of TLS.
464
- #
465
- # The +ssl+ key must be used in combination with <tt>backend: winrm</tt>.
466
- #
467
- # <em>Example kitchen.yml</em>
468
- # verifier:
469
- # name: terraform
470
- # systems:
471
- # - name: a system
472
- # backend: winrm
473
- # ssl: true
474
- #
475
- # ====== sudo
476
- #
477
- # The value of the +sudo+ key is a boolean which is used to toggle the use of
478
- # {https://en.wikipedia.org/wiki/Sudo sudo} for obtaining superuser permissions when executing tests on hosts in
479
- # the system.
480
- #
481
- # The +sudo+ key is only effective for a system which has Unix-like hosts.
482
- #
483
- # <em>Example kitchen.yml</em>
484
- # verifier:
485
- # name: terraform
486
- # systems:
487
- # - name: a system
488
- # backend: ssh
489
- # hosts_output: an_output
490
- # sudo: true
491
- #
492
- # ====== sudo_command
493
- #
494
- # The value of the +sudo_command+ key is a scalar which is used to override the default command used to
495
- # invoke sudo.
496
- #
497
- # The +sudo_command+ key must be used in combination with <tt>sudo: true</tt>.
498
- #
499
- # <em>Example kitchen.yml</em>
500
- # verifier:
501
- # name: terraform
502
- # systems:
503
- # - name: a system
504
- # backend: ssh
505
- # hosts_output: an_output
506
- # sudo: true
507
- # sudo_command: /bin/sudo
508
- #
509
- # ====== sudo_options
510
- #
511
- # The value of the +sudo_options+ key is a scalar which is used to provide options to the sudo command.
512
- #
513
- # The +sudo_options+ key must be used in combination with <tt>sudo: true</tt>.
514
- #
515
- # <em>Example kitchen.yml</em>
516
- # verifier:
517
- # name: terraform
518
- # systems:
519
- # - name: a system
520
- # backend: ssh
521
- # hosts_output: an_output
522
- # sudo: true
523
- # sudo_options: -u admin
524
- #
525
- # ====== sudo_password
526
- #
527
- # The value of the +sudo_password+ key is a scalar which is used as the password for authentication with the sudo
528
- # command.
529
- #
530
- # The +sudo_password+ key must be used in combination with <tt>sudo: true</tt>.
531
- #
532
- # <em>Example kitchen.yml</em>
533
- # verifier:
534
- # name: terraform
535
- # systems:
536
- # - name: a system
537
- # backend: ssh
538
- # hosts_output: an_output
539
- # sudo: true
540
- # sudo_password: Th3P455I5Th3W0rd
541
- #
542
- # ====== user
543
- #
544
- # The value of the +user+ key is a scalar which is used as the username for authentication with hosts in the
545
- # system.
546
- #
547
- # The +user+ key must be used in combination with a backend which supports user authentication.
548
- #
549
- # <em>Example kitchen.yml</em>
550
- # verifier:
551
- # name: terraform
552
- # systems:
553
- # - name: a system
554
- # backend: ssh
555
- # user: tester
556
- #
557
- # ====== vendor_cache
558
- #
559
- # The value of the +vendor_cache+ key is a scalar which is used as the pathname of the directory in which InSpec
560
- # will cache dependencies of the profile.
561
- #
562
- # <em>Example kitchen.yml</em>
563
- # verifier:
564
- # name: terraform
565
- # systems:
566
- # - name: a system
567
- # backend: local
568
- # vendor_cache: /opt/inspec-cache
569
- System = ::Dry::Validation.Params do
570
- required(:name).filled :str?
571
- required(:backend).filled :str?
572
- optional(:attrs).each(:filled?, :str?)
573
- optional(:attrs_outputs).filled :hash?
574
- optional(:backend_cache).value :bool?
575
- optional(:bastion_host).filled :str?
576
- optional(:bastion_host_output).filled :str?
577
- optional(:bastion_port).value :int?
578
- optional(:bastion_user).filled :str?
579
- optional(:controls).each(:filled?, :str?)
580
- optional(:enable_password).filled :str?
581
- optional(:hosts).each :filled?, :str?
582
- optional(:hosts_output).filled :str?
583
- optional(:key_files).each(:filled?, :str?)
584
- optional(:password).filled :str?
585
- optional(:path).filled :str?
586
- optional(:port).value :int?
587
- optional(:profile_locations).each :filled?, :str?
588
- optional(:proxy_command).filled :str?
589
- optional(:reporter).each(:filled?, :str?)
590
- optional(:self_signed).value :bool?
591
- optional(:shell).value :bool?
592
- optional(:shell_command).filled :str?
593
- optional(:shell_options).filled :str?
594
- optional(:show_progress).value :bool?
595
- optional(:ssl).value :bool?
596
- optional(:sudo).value :bool?
597
- optional(:sudo_command).filled :str?
598
- optional(:sudo_options).filled :str?
599
- optional(:sudo_password).filled :str?
600
- optional(:user).filled :str?
601
- optional(:vendor_cache).filled :str?
602
- end.dup
603
-
604
- System.define_singleton_method :to_s do
605
- "Kitchen::Terraform::ConfigSchemas::System"
606
- end
607
- end
608
- end
609
- end