vagrant/plugins/guests/esxi/cap/change_host_name.rb

14 lines
359 B
Ruby

module VagrantPlugins
module GuestEsxi
module Cap
class ChangeHostName
def self.change_host_name(machine, name)
if !machine.communicate.test("localcli system hostname get | grep '#{name}'")
machine.communicate.execute("localcli system hostname set -H '#{name}'")
end
end
end
end
end
end