Class: Actions::ForemanPatch::Invocation::Action::TemplateInvocation

Inherits:
Object
  • Object
show all
Defined in:
app/lib/actions/foreman_patch/invocation/action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template, **input_values) ⇒ TemplateInvocation

Returns a new instance of TemplateInvocation.



20
21
22
23
24
25
26
# File 'app/lib/actions/foreman_patch/invocation/action.rb', line 20

def initialize(template, **input_values)
  @template = template
  
  @input_values = template.template_inputs_with_foreign.map do |template_input|
    TemplateInvocationInputValue.new(self, template_input, input_values[template_input.name.intern])
  end
end

Instance Attribute Details

#input_valuesObject (readonly)

Returns the value of attribute input_values.



18
19
20
# File 'app/lib/actions/foreman_patch/invocation/action.rb', line 18

def input_values
  @input_values
end

#templateObject (readonly)

Returns the value of attribute template.



18
19
20
# File 'app/lib/actions/foreman_patch/invocation/action.rb', line 18

def template
  @template
end

Instance Method Details

#effective_userObject



28
29
30
31
32
33
34
# File 'app/lib/actions/foreman_patch/invocation/action.rb', line 28

def effective_user
  if template.provider.supports_effective_user?
    Setting[:remote_execution_effective_user]
  else
    nil
  end
end