mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
Merge 01e95ce31e into 5fa65b6400
This commit is contained in:
commit
bf049ecfd2
1 changed files with 21 additions and 14 deletions
|
|
@ -21,7 +21,12 @@ class Ssh
|
||||||
os_types = {}
|
os_types = {}
|
||||||
os_types[host_os] = 1
|
os_types[host_os] = 1
|
||||||
|
|
||||||
|
if host_os =~ /.*\..*/
|
||||||
|
cmd = "#{ssh_path} root@#{host_os}"
|
||||||
|
Kernel.exec(cmd)
|
||||||
|
else
|
||||||
response = Pooler.retrieve(verbose, os_types, token, url)
|
response = Pooler.retrieve(verbose, os_types, token, url)
|
||||||
|
|
||||||
if response["ok"] == true
|
if response["ok"] == true
|
||||||
if host_os =~ /win/
|
if host_os =~ /win/
|
||||||
user = "Administrator"
|
user = "Administrator"
|
||||||
|
|
@ -30,6 +35,7 @@ class Ssh
|
||||||
end
|
end
|
||||||
|
|
||||||
hostname = "#{response[host_os]["hostname"]}.#{response["domain"]}"
|
hostname = "#{response[host_os]["hostname"]}.#{response["domain"]}"
|
||||||
|
|
||||||
cmd = "#{ssh_path} #{user}@#{hostname}"
|
cmd = "#{ssh_path} #{user}@#{hostname}"
|
||||||
|
|
||||||
# TODO: Should this respect more ssh settings? Can it be configured
|
# TODO: Should this respect more ssh settings? Can it be configured
|
||||||
|
|
@ -38,6 +44,7 @@ class Ssh
|
||||||
else
|
else
|
||||||
raise "Could not get vm from vmpooler:\n #{response}"
|
raise "Could not get vm from vmpooler:\n #{response}"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue