Class: Kitchen::Terraform::Client::Options
- Inherits:
-
Object
- Object
- Kitchen::Terraform::Client::Options
- Defined in:
- lib/kitchen/terraform/client/options.rb
Overview
Represents supported options for client commands.
Instance Method Summary collapse
-
#backend_config(key:, value:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -backend-config with arguments to the options.
-
#backend_configs(keys_and_values:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -backend-config with arguments to the options multiple times.
-
#disable_input ⇒ ::Kitchen::Terraform::Client::Options
Adds -input=false to the options.
-
#enable_auto_approve ⇒ ::Kitchen::Terraform::Client::Options
Adds -auto-approve=true to the options.
-
#enable_backend ⇒ ::Kitchen::Terraform::Client::Options
Adds -backend=true to the options.
-
#enable_check_variables ⇒ ::Kitchen::Terraform::Client::Options
Adds -check-variables=true to the options.
-
#enable_get ⇒ ::Kitchen::Terraform::Client::Options
Adds -get=true to the options.
-
#enable_lock ⇒ ::Kitchen::Terraform::Client::Options
Adds -lock=true to the options.
-
#enable_refresh ⇒ ::Kitchen::Terraform::Client::Options
Adds -refresh=true to the options.
-
#force ⇒ ::Kitchen::Terraform::Client::Options
Adds -force to the options.
-
#force_copy ⇒ ::Kitchen::Terraform::Client::Options
Adds -force-copy to the options.
-
#from_module(source:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -from-module with an argument to the options.
-
#json ⇒ ::Kitchen::Terraform::Client::Options
Adds -json to the options.
-
#lock_timeout(duration:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -lock-timeout with an argument to the options.
-
#maybe_no_color(toggle:) ⇒ ::Kitchen::Terraform::Client::Options
Conditionally adds -no-color to the options.
-
#maybe_plugin_dir(path:) ⇒ ::Kitchen::Terraform::Client::Options
Conditionally adds -plugin-dir to the options.
-
#no_color ⇒ ::Kitchen::Terraform::Client::Options
Adds -no-color to the options.
-
#parallelism(concurrent_operations:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -parallelism with an argument to the options.
-
#plugin_dir(path:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -plugin-dir with an argument to the options.
-
#state(path:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -state with an argument to the options.
-
#state_out(path:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -state-out with an argument to the options.
-
#to_s ⇒ ::String
The options expressed as a space delimited string.
-
#upgrade ⇒ ::Kitchen::Terraform::Client::Options
Adds -upgrade to the options.
-
#var(key:, value:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -var with arguments to the options.
-
#var_file(path:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -var-file with an argument to the options.
-
#var_files(paths:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -var-file with an argument to the options multiple times.
-
#vars(keys_and_values:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -var with arguments to the options multiple times.
-
#verify_plugins(toggle:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -verify-plugins with an argument to the options.
Instance Method Details
#backend_config(key:, value:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -backend-config with arguments to the options.
26 27 28 |
# File 'lib/kitchen/terraform/client/options.rb', line 26 def backend_config(key:, value:) add option: "-backend-config='#{key}=#{value}'" end |
#backend_configs(keys_and_values:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -backend-config with arguments to the options multiple times.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/kitchen/terraform/client/options.rb', line 34 def backend_configs(keys_and_values:) keys_and_values .inject self do |, (key, value)| .backend_config( key: key, value: value ) end end |
#disable_input ⇒ ::Kitchen::Terraform::Client::Options
Adds -input=false to the options.
48 49 50 |
# File 'lib/kitchen/terraform/client/options.rb', line 48 def disable_input add option: "-input=false" end |
#enable_auto_approve ⇒ ::Kitchen::Terraform::Client::Options
Adds -auto-approve=true to the options.
55 56 57 |
# File 'lib/kitchen/terraform/client/options.rb', line 55 def enable_auto_approve add option: "-auto-approve=true" end |
#enable_backend ⇒ ::Kitchen::Terraform::Client::Options
Adds -backend=true to the options.
62 63 64 |
# File 'lib/kitchen/terraform/client/options.rb', line 62 def enable_backend add option: "-backend=true" end |
#enable_check_variables ⇒ ::Kitchen::Terraform::Client::Options
Adds -check-variables=true to the options.
69 70 71 |
# File 'lib/kitchen/terraform/client/options.rb', line 69 def enable_check_variables add option: "-check-variables=true" end |
#enable_get ⇒ ::Kitchen::Terraform::Client::Options
Adds -get=true to the options.
76 77 78 |
# File 'lib/kitchen/terraform/client/options.rb', line 76 def enable_get add option: "-get=true" end |
#enable_lock ⇒ ::Kitchen::Terraform::Client::Options
Adds -lock=true to the options.
112 113 114 |
# File 'lib/kitchen/terraform/client/options.rb', line 112 def enable_lock add option: "-lock=true" end |
#enable_refresh ⇒ ::Kitchen::Terraform::Client::Options
Adds -refresh=true to the options.
119 120 121 |
# File 'lib/kitchen/terraform/client/options.rb', line 119 def enable_refresh add option: "-refresh=true" end |
#force ⇒ ::Kitchen::Terraform::Client::Options
Adds -force to the options.
83 84 85 |
# File 'lib/kitchen/terraform/client/options.rb', line 83 def force add option: "-force" end |
#force_copy ⇒ ::Kitchen::Terraform::Client::Options
Adds -force-copy to the options.
90 91 92 |
# File 'lib/kitchen/terraform/client/options.rb', line 90 def force_copy add option: "-force-copy" end |
#from_module(source:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -from-module with an argument to the options.
98 99 100 |
# File 'lib/kitchen/terraform/client/options.rb', line 98 def from_module(source:) add option: "-from-module=#{source}" end |
#json ⇒ ::Kitchen::Terraform::Client::Options
Adds -json to the options.
105 106 107 |
# File 'lib/kitchen/terraform/client/options.rb', line 105 def json add option: "-json" end |
#lock_timeout(duration:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -lock-timeout with an argument to the options.
127 128 129 |
# File 'lib/kitchen/terraform/client/options.rb', line 127 def lock_timeout(duration:) add option: "-lock-timeout=#{duration}" end |
#maybe_no_color(toggle:) ⇒ ::Kitchen::Terraform::Client::Options
Conditionally adds -no-color to the options.
135 136 137 |
# File 'lib/kitchen/terraform/client/options.rb', line 135 def maybe_no_color(toggle:) toggle and no_color or self end |
#maybe_plugin_dir(path:) ⇒ ::Kitchen::Terraform::Client::Options
Conditionally adds -plugin-dir to the options.
143 144 145 |
# File 'lib/kitchen/terraform/client/options.rb', line 143 def maybe_plugin_dir(path:) path and plugin_dir path: path or self end |
#no_color ⇒ ::Kitchen::Terraform::Client::Options
Adds -no-color to the options.
150 151 152 |
# File 'lib/kitchen/terraform/client/options.rb', line 150 def no_color add option: "-no-color" end |
#parallelism(concurrent_operations:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -parallelism with an argument to the options.
158 159 160 |
# File 'lib/kitchen/terraform/client/options.rb', line 158 def parallelism(concurrent_operations:) add option: "-parallelism=#{concurrent_operations}" end |
#plugin_dir(path:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -plugin-dir with an argument to the options.
166 167 168 |
# File 'lib/kitchen/terraform/client/options.rb', line 166 def plugin_dir(path:) add option: "-plugin-dir=#{path}" end |
#state(path:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -state with an argument to the options.
174 175 176 |
# File 'lib/kitchen/terraform/client/options.rb', line 174 def state(path:) add option: "-state=#{path}" end |
#state_out(path:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -state-out with an argument to the options.
182 183 184 |
# File 'lib/kitchen/terraform/client/options.rb', line 182 def state_out(path:) add option: "-state-out=#{path}" end |
#to_s ⇒ ::String
The options expressed as a space delimited string.
247 248 249 |
# File 'lib/kitchen/terraform/client/options.rb', line 247 def to_s .join " " end |
#upgrade ⇒ ::Kitchen::Terraform::Client::Options
Adds -upgrade to the options.
189 190 191 |
# File 'lib/kitchen/terraform/client/options.rb', line 189 def upgrade add option: "-upgrade" end |
#var(key:, value:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -var with arguments to the options.
198 199 200 |
# File 'lib/kitchen/terraform/client/options.rb', line 198 def var(key:, value:) add option: "-var='#{key}=#{value}'" end |
#var_file(path:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -var-file with an argument to the options.
221 222 223 |
# File 'lib/kitchen/terraform/client/options.rb', line 221 def var_file(path:) add option: "-var-file=#{path}" end |
#var_files(paths:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -var-file with an argument to the options multiple times.
229 230 231 232 233 234 |
# File 'lib/kitchen/terraform/client/options.rb', line 229 def var_files(paths:) paths .inject self do |, path| .var_file path: path end end |
#vars(keys_and_values:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -var with arguments to the options multiple times.
206 207 208 209 210 211 212 213 214 215 |
# File 'lib/kitchen/terraform/client/options.rb', line 206 def vars(keys_and_values:) keys_and_values .inject self do |, (key, value)| .var( key: key, value: value ) end end |
#verify_plugins(toggle:) ⇒ ::Kitchen::Terraform::Client::Options
Adds -verify-plugins with an argument to the options.
240 241 242 |
# File 'lib/kitchen/terraform/client/options.rb', line 240 def verify_plugins(toggle:) add option: "-verify-plugins=#{toggle}" end |