kitchen-terraform 5.8.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +17 -16
- data/lib/kitchen/driver/terraform.rb +1 -1
- data/lib/kitchen/provisioner/terraform.rb +1 -1
- data/lib/kitchen/terraform.rb +1 -1
- data/lib/kitchen/terraform/breaking.rb +1 -1
- data/lib/kitchen/terraform/command.rb +1 -1
- data/lib/kitchen/terraform/command/apply.rb +1 -1
- data/lib/kitchen/terraform/command/destroy.rb +1 -1
- data/lib/kitchen/terraform/command/get.rb +1 -1
- data/lib/kitchen/terraform/command/init.rb +1 -1
- data/lib/kitchen/terraform/command/init/post_zero_fifteen_zero.rb +1 -1
- data/lib/kitchen/terraform/command/init/pre_zero_fifteen_zero.rb +1 -1
- data/lib/kitchen/terraform/command/init_factory.rb +1 -1
- data/lib/kitchen/terraform/command/output.rb +1 -1
- data/lib/kitchen/terraform/command/validate.rb +1 -1
- data/lib/kitchen/terraform/command/validate/post_zero_fifteen_zero.rb +1 -1
- data/lib/kitchen/terraform/command/validate/pre_zero_fifteen_zero.rb +1 -1
- data/lib/kitchen/terraform/command/validate_factory.rb +1 -1
- data/lib/kitchen/terraform/command/version.rb +1 -1
- data/lib/kitchen/terraform/command/workspace_delete.rb +1 -1
- data/lib/kitchen/terraform/command/workspace_new.rb +1 -1
- data/lib/kitchen/terraform/command/workspace_select.rb +1 -1
- data/lib/kitchen/terraform/command_executor.rb +3 -5
- data/lib/kitchen/terraform/command_flag.rb +1 -1
- data/lib/kitchen/terraform/command_flag/backend_config.rb +1 -1
- data/lib/kitchen/terraform/command_flag/color.rb +1 -1
- data/lib/kitchen/terraform/command_flag/lock_timeout.rb +1 -1
- data/lib/kitchen/terraform/command_flag/plugin_dir.rb +1 -1
- data/lib/kitchen/terraform/command_flag/upgrade.rb +1 -1
- data/lib/kitchen/terraform/command_flag/var.rb +1 -1
- data/lib/kitchen/terraform/command_flag/var_file.rb +1 -1
- data/lib/kitchen/terraform/config_attribute.rb +1 -1
- data/lib/kitchen/terraform/config_attribute/backend_configurations.rb +1 -1
- data/lib/kitchen/terraform/config_attribute/client.rb +3 -3
- data/lib/kitchen/terraform/config_attribute/color.rb +3 -3
- data/lib/kitchen/terraform/config_attribute/command_timeout.rb +1 -1
- data/lib/kitchen/terraform/config_attribute/fail_fast.rb +3 -3
- data/lib/kitchen/terraform/config_attribute/lock.rb +3 -3
- data/lib/kitchen/terraform/config_attribute/lock_timeout.rb +1 -1
- data/lib/kitchen/terraform/config_attribute/parallelism.rb +1 -1
- data/lib/kitchen/terraform/config_attribute/plugin_directory.rb +3 -3
- data/lib/kitchen/terraform/config_attribute/root_module_directory.rb +3 -3
- data/lib/kitchen/terraform/config_attribute/systems.rb +552 -4
- data/lib/kitchen/terraform/config_attribute/variable_files.rb +3 -3
- data/lib/kitchen/terraform/config_attribute/variables.rb +1 -1
- data/lib/kitchen/terraform/config_attribute/verify_version.rb +3 -3
- data/lib/kitchen/terraform/config_attribute_cacher.rb +1 -1
- data/lib/kitchen/terraform/{config_predicates.rb → config_attribute_contract.rb} +3 -3
- data/lib/kitchen/terraform/config_attribute_contract/array_of_strings.rb +30 -0
- data/lib/kitchen/terraform/{config_schemas → config_attribute_contract}/boolean.rb +7 -11
- data/lib/kitchen/terraform/config_attribute_contract/hash_of_symbols_and_strings.rb +41 -0
- data/lib/kitchen/terraform/{config_schemas.rb → config_attribute_contract/integer.rb} +10 -3
- data/lib/kitchen/terraform/config_attribute_contract/optional_string.rb +30 -0
- data/lib/kitchen/terraform/{config_schemas → config_attribute_contract}/string.rb +7 -9
- data/lib/kitchen/terraform/config_attribute_contract/systems.rb +63 -0
- data/lib/kitchen/terraform/config_attribute_definer.rb +2 -2
- data/lib/kitchen/terraform/config_attribute_type.rb +1 -1
- data/lib/kitchen/terraform/config_attribute_type/hash_of_symbols_and_strings.rb +9 -16
- data/lib/kitchen/terraform/config_attribute_type/integer.rb +27 -23
- data/lib/kitchen/terraform/configurable.rb +1 -1
- data/lib/kitchen/terraform/debug_logger.rb +1 -1
- data/lib/kitchen/terraform/deprecating.rb +1 -1
- data/lib/kitchen/terraform/driver.rb +1 -1
- data/lib/kitchen/terraform/driver/create.rb +5 -5
- data/lib/kitchen/terraform/driver/destroy.rb +8 -8
- data/lib/kitchen/terraform/error.rb +1 -1
- data/lib/kitchen/terraform/file_path_config_attribute_definer.rb +1 -1
- data/lib/kitchen/terraform/inspec.rb +1 -1
- data/lib/kitchen/terraform/inspec/fail_fast_with_hosts.rb +1 -1
- data/lib/kitchen/terraform/inspec/fail_slow_with_hosts.rb +1 -1
- data/lib/kitchen/terraform/inspec/without_hosts.rb +1 -1
- data/lib/kitchen/terraform/inspec_factory.rb +1 -1
- data/lib/kitchen/terraform/inspec_options_factory.rb +1 -1
- data/lib/kitchen/terraform/inspec_runner.rb +1 -1
- data/lib/kitchen/terraform/outputs_manager.rb +1 -1
- data/lib/kitchen/terraform/outputs_parser.rb +1 -1
- data/lib/kitchen/terraform/outputs_reader.rb +2 -2
- data/lib/kitchen/terraform/provisioner.rb +1 -1
- data/lib/kitchen/terraform/provisioner/converge.rb +6 -6
- data/lib/kitchen/terraform/raise.rb +1 -1
- data/lib/kitchen/terraform/raise/action_failed.rb +1 -1
- data/lib/kitchen/terraform/raise/client_error.rb +1 -1
- data/lib/kitchen/terraform/shell_out.rb +2 -2
- data/lib/kitchen/terraform/system.rb +1 -1
- data/lib/kitchen/terraform/system_attrs_inputs_resolver.rb +1 -1
- data/lib/kitchen/terraform/system_attrs_outputs_resolver.rb +1 -1
- data/lib/kitchen/terraform/system_bastion_host_resolver.rb +1 -1
- data/lib/kitchen/terraform/system_hosts_resolver.rb +1 -1
- data/lib/kitchen/terraform/system_inspec_map.rb +1 -1
- data/lib/kitchen/terraform/systems_verifier.rb +1 -1
- data/lib/kitchen/terraform/systems_verifier/fail_fast.rb +1 -1
- data/lib/kitchen/terraform/systems_verifier/fail_slow.rb +1 -1
- data/lib/kitchen/terraform/systems_verifier_factory.rb +1 -1
- data/lib/kitchen/terraform/unsupported_client_version_error.rb +1 -1
- data/lib/kitchen/terraform/variables_manager.rb +1 -1
- data/lib/kitchen/terraform/verify_version.rb +1 -1
- data/lib/kitchen/terraform/verify_version_rescue_strategy.rb +1 -1
- data/lib/kitchen/terraform/verify_version_rescue_strategy/permissive.rb +1 -1
- data/lib/kitchen/terraform/verify_version_rescue_strategy/strict.rb +1 -1
- data/lib/kitchen/terraform/verify_version_rescue_strategy_factory.rb +1 -1
- data/lib/kitchen/terraform/version.rb +2 -2
- data/lib/kitchen/terraform/version_verifier.rb +1 -1
- data/lib/kitchen/terraform/version_verifier_strategy.rb +1 -1
- data/lib/kitchen/terraform/version_verifier_strategy/supported.rb +1 -1
- data/lib/kitchen/terraform/version_verifier_strategy/unsupported.rb +1 -1
- data/lib/kitchen/terraform/version_verifier_strategy_factory.rb +1 -1
- data/lib/kitchen/verifier/terraform.rb +1 -1
- metadata +60 -49
- metadata.gz.sig +0 -0
- data/lib/kitchen/terraform/config_predicates/hash_of_symbols_and_strings.rb +0 -81
- data/lib/kitchen/terraform/config_schemas/array_of_strings.rb +0 -38
- data/lib/kitchen/terraform/config_schemas/optional_string.rb +0 -38
- data/lib/kitchen/terraform/config_schemas/system.rb +0 -609
- data/lib/kitchen/terraform/config_schemas/systems.rb +0 -37
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright 2016-
|
3
|
+
# Copyright 2016-2021 Copado NCS LLC
|
4
4
|
#
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
# you may not use this file except in compliance with the License.
|
@@ -105,7 +105,7 @@ module Kitchen
|
|
105
105
|
|
106
106
|
def create_or_select_workspace
|
107
107
|
logger.warn "Creating the #{workspace_name} Terraform workspace..."
|
108
|
-
command_executor.run command: workspace_new, options: options do |standard_output
|
108
|
+
command_executor.run command: workspace_new, options: options do |standard_output|
|
109
109
|
end
|
110
110
|
logger.warn "Finished creating the #{workspace_name} Terraform workspace."
|
111
111
|
rescue ::Kitchen::TransientFailure
|
@@ -118,14 +118,14 @@ module Kitchen
|
|
118
118
|
command: ::Kitchen::Terraform::Command::InitFactory.new(version: client_version)
|
119
119
|
.build(config: complete_config),
|
120
120
|
options: options,
|
121
|
-
) do |standard_output
|
121
|
+
) do |standard_output|
|
122
122
|
end
|
123
123
|
logger.warn "Finished initializing the Terraform working directory."
|
124
124
|
end
|
125
125
|
|
126
126
|
def read_client_version
|
127
127
|
logger.warn "Reading the Terraform client version..."
|
128
|
-
command_executor.run command: version, options: options do |standard_output
|
128
|
+
command_executor.run command: version, options: options do |standard_output|
|
129
129
|
self.client_version = ::Gem::Version.new standard_output.slice /Terraform v(\d+\.\d+\.\d+)/, 1
|
130
130
|
end
|
131
131
|
logger.warn "Finished reading the Terraform client version."
|
@@ -133,7 +133,7 @@ module Kitchen
|
|
133
133
|
|
134
134
|
def select_workspace
|
135
135
|
logger.warn "Selecting the #{workspace_name} Terraform workspace..."
|
136
|
-
command_executor.run command: workspace_select, options: options do |standard_output
|
136
|
+
command_executor.run command: workspace_select, options: options do |standard_output|
|
137
137
|
end
|
138
138
|
logger.warn "Finished selecting the #{workspace_name} Terraform workspace."
|
139
139
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright 2016-
|
3
|
+
# Copyright 2016-2021 Copado NCS LLC
|
4
4
|
#
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
# you may not use this file except in compliance with the License.
|
@@ -124,7 +124,7 @@ module Kitchen
|
|
124
124
|
|
125
125
|
def create_test_workspace
|
126
126
|
logger.warn "Creating the #{workspace_name} Terraform workspace..."
|
127
|
-
command_executor.run command: workspace_new_test, options: options do |standard_output
|
127
|
+
command_executor.run command: workspace_new_test, options: options do |standard_output|
|
128
128
|
end
|
129
129
|
logger.warn "Finished creating the #{workspace_name} Terraform workspace."
|
130
130
|
end
|
@@ -141,14 +141,14 @@ module Kitchen
|
|
141
141
|
|
142
142
|
def destroy_infrastructure
|
143
143
|
logger.warn "Destroying the Terraform-managed infrastructure..."
|
144
|
-
command_executor.run command: destroy, options: destroy_options do |standard_output
|
144
|
+
command_executor.run command: destroy, options: destroy_options do |standard_output|
|
145
145
|
end
|
146
146
|
logger.warn "Finished destroying the Terraform-managed infrastructure."
|
147
147
|
end
|
148
148
|
|
149
149
|
def delete_test_workspace
|
150
150
|
logger.warn "Deleting the #{workspace_name} Terraform workspace..."
|
151
|
-
command_executor.run command: workspace_delete_test, options: options do |standard_output
|
151
|
+
command_executor.run command: workspace_delete_test, options: options do |standard_output|
|
152
152
|
end
|
153
153
|
logger.warn "Finished deleting the #{workspace_name} Terraform workspace."
|
154
154
|
end
|
@@ -167,14 +167,14 @@ module Kitchen
|
|
167
167
|
command: ::Kitchen::Terraform::Command::InitFactory.new(version: client_version)
|
168
168
|
.build(config: complete_config),
|
169
169
|
options: options,
|
170
|
-
) do |standard_output
|
170
|
+
) do |standard_output|
|
171
171
|
end
|
172
172
|
logger.warn "Finished initializing the Terraform working directory."
|
173
173
|
end
|
174
174
|
|
175
175
|
def read_client_version
|
176
176
|
logger.warn "Reading the Terraform client version..."
|
177
|
-
command_executor.run command: version, options: options do |standard_output
|
177
|
+
command_executor.run command: version, options: options do |standard_output|
|
178
178
|
self.client_version = ::Gem::Version.new standard_output.slice /Terraform v(\d+\.\d+\.\d+)/, 1
|
179
179
|
end
|
180
180
|
logger.warn "Finished reading the Terraform client version."
|
@@ -182,14 +182,14 @@ module Kitchen
|
|
182
182
|
|
183
183
|
def select_default_workspace
|
184
184
|
logger.warn "Selecting the default Terraform workspace..."
|
185
|
-
command_executor.run command: workspace_select_default, options: options do |standard_output
|
185
|
+
command_executor.run command: workspace_select_default, options: options do |standard_output|
|
186
186
|
end
|
187
187
|
logger.warn "Finished selecting the default Terraform workspace."
|
188
188
|
end
|
189
189
|
|
190
190
|
def select_or_create_test_workspace
|
191
191
|
logger.warn "Selecting the #{workspace_name} Terraform workspace..."
|
192
|
-
command_executor.run command: workspace_select_test, options: options do |standard_output
|
192
|
+
command_executor.run command: workspace_select_test, options: options do |standard_output|
|
193
193
|
end
|
194
194
|
logger.warn "Finished selecting the #{workspace_name} Terraform workspace."
|
195
195
|
rescue ::Kitchen::TransientFailure
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright 2016-
|
3
|
+
# Copyright 2016-2021 Copado NCS LLC
|
4
4
|
#
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
# you may not use this file except in compliance with the License.
|
@@ -48,7 +48,7 @@ module Kitchen
|
|
48
48
|
attr_accessor :command_executor, :no_outputs_defined
|
49
49
|
|
50
50
|
def run(command:, options:)
|
51
|
-
command_executor.run command: command, options: options do |standard_output
|
51
|
+
command_executor.run command: command, options: options do |standard_output|
|
52
52
|
yield json_outputs: standard_output
|
53
53
|
end
|
54
54
|
rescue ::Kitchen::TransientFailure => error
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright 2016-
|
3
|
+
# Copyright 2016-2021 Copado NCS LLC
|
4
4
|
#
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
# you may not use this file except in compliance with the License.
|
@@ -131,14 +131,14 @@ module Kitchen
|
|
131
131
|
|
132
132
|
def build_infrastructure
|
133
133
|
logger.warn "Building the infrastructure based on the Terraform configuration..."
|
134
|
-
command_executor.run command: apply, options: options do |standard_output
|
134
|
+
command_executor.run command: apply, options: options do |standard_output|
|
135
135
|
end
|
136
136
|
logger.warn "Finished building the infrastructure based on the Terraform configuration."
|
137
137
|
end
|
138
138
|
|
139
139
|
def download_modules
|
140
140
|
logger.warn "Downloading the modules needed for the Terraform configuration..."
|
141
|
-
command_executor.run command: get, options: options do |standard_output
|
141
|
+
command_executor.run command: get, options: options do |standard_output|
|
142
142
|
end
|
143
143
|
logger.warn "Finished downloading the modules needed for the Terraform configuration."
|
144
144
|
end
|
@@ -189,7 +189,7 @@ module Kitchen
|
|
189
189
|
|
190
190
|
def read_client_version
|
191
191
|
logger.warn "Reading the Terraform client version..."
|
192
|
-
command_executor.run command: version, options: options do |standard_output
|
192
|
+
command_executor.run command: version, options: options do |standard_output|
|
193
193
|
self.client_version = ::Gem::Version.new standard_output.slice /Terraform v(\d+\.\d+\.\d+)/, 1
|
194
194
|
end
|
195
195
|
logger.warn "Finished reading the Terraform client version."
|
@@ -212,7 +212,7 @@ module Kitchen
|
|
212
212
|
|
213
213
|
def select_workspace
|
214
214
|
logger.warn "Selecting the #{workspace_name} Terraform workspace..."
|
215
|
-
command_executor.run command: workspace_select, options: options do |standard_output
|
215
|
+
command_executor.run command: workspace_select, options: options do |standard_output|
|
216
216
|
end
|
217
217
|
logger.warn "Finished selecting the #{workspace_name} Terraform workspace."
|
218
218
|
end
|
@@ -223,7 +223,7 @@ module Kitchen
|
|
223
223
|
command: ::Kitchen::Terraform::Command::ValidateFactory.new(version: client_version)
|
224
224
|
.build(config: complete_config),
|
225
225
|
options: options,
|
226
|
-
) do |standard_output
|
226
|
+
) do |standard_output|
|
227
227
|
end
|
228
228
|
logger.warn "Finished validating the Terraform configuration files."
|
229
229
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright 2016-
|
3
|
+
# Copyright 2016-2021 Copado NCS LLC
|
4
4
|
#
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
# you may not use this file except in compliance with the License.
|
@@ -51,7 +51,7 @@ module Kitchen
|
|
51
51
|
def run
|
52
52
|
execute_workflow
|
53
53
|
|
54
|
-
yield
|
54
|
+
yield shell_out.stdout
|
55
55
|
|
56
56
|
self
|
57
57
|
end
|