Created
August 8, 2014 16:13
-
-
Save josqu4red/4b4ae02f13651a176355 to your computer and use it in GitHub Desktop.
Sane setup for ILO baseboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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