Class: Ansible::Ruby::DslBuilders::Unit

Inherits:
Base
  • Object
show all
Defined in:
lib/ansible/ruby/dsl_builders/unit.rb

Direct Known Subclasses

Block, Task

Instance Method Summary collapse

Methods inherited from Base

#_result, #jinja, #method_missing, #respond_to_missing?

Constructor Details

#initializeUnit

Returns a new instance of Unit.



6
7
8
9
10
# File 'lib/ansible/ruby/dsl_builders/unit.rb', line 6

def initialize
  super()
  @temp_counter = 0
  @task_args = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ansible::Ruby::DslBuilders::Base

Instance Method Details

#ansible_when(clause) ⇒ Object



21
22
23
# File 'lib/ansible/ruby/dsl_builders/unit.rb', line 21

def ansible_when(clause)
  @task_args[:when] = clause
end

#become(*args) ⇒ Object



12
13
14
15
# File 'lib/ansible/ruby/dsl_builders/unit.rb', line 12

def become(*args)
  value = _implicit_bool args
  @task_args[:become] = value
end

#become_user(value) ⇒ Object



17
18
19
# File 'lib/ansible/ruby/dsl_builders/unit.rb', line 17

def become_user(value)
  @task_args[:become_user] = value
end

#ignore_errors(*args) ⇒ Object



25
26
27
28
# File 'lib/ansible/ruby/dsl_builders/unit.rb', line 25

def ignore_errors(*args)
  value = _implicit_bool args
  @task_args[:ignore_errors] = value
end