Class: Actions::ForemanChef::Host::Update

Inherits:
EntryAction
  • Object
show all
Defined in:
app/lib/actions/foreman_chef/host/update.rb

Instance Method Summary collapse

Instance Method Details

#humanized_inputObject



28
29
30
# File 'app/lib/actions/foreman_chef/host/update.rb', line 28

def humanized_input
  input[:host][:name]
end

#humanized_nameObject



24
25
26
# File 'app/lib/actions/foreman_chef/host/update.rb', line 24

def humanized_name
  _("Update host")
end

#plan(host) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/lib/actions/foreman_chef/host/update.rb', line 10

def plan(host)
  action_subject(host)

  if host.chef_proxy
    node_exists_in_chef = host.chef_proxy.show_node(host.name)

    if node_exists_in_chef && host.override_chef_attributes
      plan_action Actions::ForemanChef::Node::Update, host, host.chef_proxy
    end
  end
rescue => e
  ::Foreman::Logging.exception("Unable to communicate with Chef proxy", e)
end

#resource_locksObject



6
7
8
# File 'app/lib/actions/foreman_chef/host/update.rb', line 6

def resource_locks
  :link
end