Class: Actions::Staypuft::Host::Build

Inherits:
Dynflow::Action
  • Object
show all
Defined in:
app/lib/actions/staypuft/host/build.rb

Instance Method Summary collapse

Instance Method Details

#plan(host_id) ⇒ Object



20
21
22
# File 'app/lib/actions/staypuft/host/build.rb', line 20

def plan(host_id)
  plan_self host_id: host_id
end

#runObject



24
25
26
27
28
29
30
31
32
33
# File 'app/lib/actions/staypuft/host/build.rb', line 24

def run
  host             = ::Host.find(input[:host_id])
  # return back to hostgroup's environment
  host.environment = nil
  host.expire_token
  host.set_token
  host.save!
  host.send :setTFTP
  restart(host)
end