Skip to content

Instantly share code, notes, and snippets.

@josqu4red
Created August 8, 2014 16:13
Show Gist options
  • Save josqu4red/4b4ae02f13651a176355 to your computer and use it in GitHub Desktop.
Save josqu4red/4b4ae02f13651a176355 to your computer and use it in GitHub Desktop.
Sane setup for ILO baseboard
require "ilorb"
search(:node, "bootstrap_ilo:*").sort_by{|n| n.name}.each do |n|
print "#{n.name} "
ilo_attrs = n["bootstrap"]["ilo"]
begin
ilo = ILORb.new(hostname: ilo_attrs["ip"], login: ilo_attrs["username"], password: ilo_attrs["password"])
ilo.server_name(:value => n["hostname"])
ilo.mod_network_settings(
:dhcp_enable => true,
:dhcp_domain_name => true,
:dhcp_gateway => true,
:dhcp_dns_server => true,
:dhcp_static_route => true,
:dns_name => "ILO#{n["bootstrap"]["sn"]}"
)
puts "OK"
rescue SystemExit, Interrupt
puts " skipped"
next
rescue
puts " failed"
next
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment