Class: Ruby::Terraform::Tasks::AllTasks
- Defined in:
- lib/ruby/terraform/tasks/all_tasks.rb
Instance Attribute Summary collapse
-
#auto_approve ⇒ Object
Returns the value of attribute auto_approve.
-
#backend ⇒ Object
Returns the value of attribute backend.
-
#backend_config ⇒ Object
Returns the value of attribute backend_config.
-
#build_dir ⇒ Object
Returns the value of attribute build_dir.
-
#json ⇒ Object
Returns the value of attribute json.
-
#state ⇒ Object
Returns the value of attribute state.
-
#vars ⇒ Object
Returns the value of attribute vars.
Attributes inherited from BaseTask
#configuration_name, #deps, #description, #dir, #show_command, #show_output, #task_name
Instance Method Summary collapse
Methods inherited from BaseTask
Constructor Details
This class inherits a constructor from Ruby::Terraform::Tasks::BaseTask
Instance Attribute Details
#auto_approve ⇒ Object
Returns the value of attribute auto_approve.
8 9 10 |
# File 'lib/ruby/terraform/tasks/all_tasks.rb', line 8 def auto_approve @auto_approve end |
#backend ⇒ Object
Returns the value of attribute backend.
10 11 12 |
# File 'lib/ruby/terraform/tasks/all_tasks.rb', line 10 def backend @backend end |
#backend_config ⇒ Object
Returns the value of attribute backend_config.
11 12 13 |
# File 'lib/ruby/terraform/tasks/all_tasks.rb', line 11 def backend_config @backend_config end |
#build_dir ⇒ Object
Returns the value of attribute build_dir.
15 16 17 |
# File 'lib/ruby/terraform/tasks/all_tasks.rb', line 15 def build_dir @build_dir end |
#json ⇒ Object
Returns the value of attribute json.
13 14 15 |
# File 'lib/ruby/terraform/tasks/all_tasks.rb', line 13 def json @json end |
#state ⇒ Object
Returns the value of attribute state.
6 7 8 |
# File 'lib/ruby/terraform/tasks/all_tasks.rb', line 6 def state @state end |
#vars ⇒ Object
Returns the value of attribute vars.
7 8 9 |
# File 'lib/ruby/terraform/tasks/all_tasks.rb', line 7 def vars @vars end |
Instance Method Details
#define ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/ruby/terraform/tasks/all_tasks.rb', line 17 def define dir_to_use = File.(build_dir ? "#{build_dir}/#{dir}" : dir) if build_dir task :pre_init do rm_rf dir_to_use mkdir_p File.dirname(dir_to_use) # create parent dir cp_r dir, dir_to_use end end InitTask.new(configuration_name, :init => build_dir ? [:pre_init] : []) do |task| task.dir = dir_to_use task.backend = backend task.backend_config = backend_config task.show_output = show_output task.show_command = show_command end ApplyTask.new(configuration_name, :apply => :init) do |task| task.dir = dir_to_use task.state = state task.vars = vars task.auto_approve = auto_approve task.show_output = show_output task.show_command = show_command end DestroyTask.new(configuration_name, :destroy => :init) do |task| task.dir = dir_to_use task.state = state task.vars = vars task.auto_approve = auto_approve task.show_output = show_output task.show_command = show_command end OutputTask.new(configuration_name, :output => :init) do |task| task.dir = dir_to_use task.state = state task.json = json task.show_output = show_output task.show_command = show_command end PlanTask.new(configuration_name, :plan => :init) do |task| task.dir = dir_to_use task.state = state task.vars = vars task.show_output = show_output task.show_command = show_command end ValidateTask.new(configuration_name, :validate => :init) do |task| task.dir = dir_to_use task.json = json task.show_output = show_output task.show_command = show_command end end |