Skip to content

Commit

Permalink
Final fixups for OS build
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Lowther committed Jul 26, 2011
1 parent c0258bb commit 64986dd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 21 deletions.
4 changes: 4 additions & 0 deletions build_crowbar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ clean_dirs() {
done
}

which debootstrap &>/dev/null || die "debootstrap must be installed! Exiting."
which dpkg-scanpackages &>/dev/null || die "build-essential must be installed! Exiting."


update_caches() {
# Hold a list of directories we will need to umount
TO_UMOUNT=()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,25 @@
name = new_resource.name
settle_time = new_resource.settle_time

# Make sure the IPMI kernel modules are installed
bash "install-ipmi_si" do
code "/sbin/modprobe ipmi_si"
not_if { ::File.exists?("/sys/module/ipmi_si") }
returns [0,1]
ignore_failure true
end
unless ::File.exists?("/sys/module/ipmi_devintf") and ::File.exists?("/sys/module/ipmi_si")
# Make sure the IPMI kernel modules are installed
bash "install-ipmi_si" do
code "/sbin/modprobe ipmi_si"
not_if { ::File.exists?("/sys/module/ipmi_si") }
returns [0,1]
ignore_failure true
end

bash "install-devintf" do
code "/sbin/modprobe ipmi_devintf"
not_if { ::File.exists?("/sys/module/ipmi_devintf") }
returns [0,1]
ignore_failure true
end
bash "install-devintf" do
code "/sbin/modprobe ipmi_devintf"
not_if { ::File.exists?("/sys/module/ipmi_devintf") }
returns [0,1]
ignore_failure true
end

bash "settle ipmi load" do
code "sleep #{settle_time}"
not_if { ::File.exists?("/sys/module/ipmi_devintf") and ::File.exists?("/sys/module/ipmi_si") }
bash "settle ipmi load" do
code "sleep #{settle_time}"
end
end
end

Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,25 @@
node.save

ipmi_load "ipmi_load" do
settle_time 30
action :run
end

### lan parameters to check and set. The loop that follows iterates over this array.
# [0] = name in "print" output, [1] command to issue, [2] desired value.
lan_params = [
[ "IP Address Source" ,"ipmitool lan set 1 ipsrc static", "Static Address" ] ,
[ "IP Address" ,"ipmitool lan set 1 ipaddr #{bmc_address}", bmc_address ] ,
[ "Subnet Mask" , "ipmitool lan set 1 netmask #{bmc_netmask}", bmc_netmask ]
[ "IP Address Source" ,"ipmitool lan set 1 ipsrc static", "Static Address", 10 ] ,
[ "IP Address" ,"ipmitool lan set 1 ipaddr #{bmc_address}", bmc_address, 1 ] ,
[ "Subnet Mask" , "ipmitool lan set 1 netmask #{bmc_netmask}", bmc_netmask, 1 ]
]

lan_params << [ "Default Gateway IP", "ipmitool lan set 1 defgw ipaddr #{bmc_router}", bmc_router ] unless bmc_router.nil?
lan_params << [ "Default Gateway IP", "ipmitool lan set 1 defgw ipaddr #{bmc_router}", bmc_router, 1 ] unless bmc_router.nil?

lan_params.each do |param|
ipmi_lan_set "#{param[0]}" do
command param[1]
value param[2]
settle_time param[3]
action :run
end
end
Expand All @@ -69,14 +71,15 @@
end

bmc_commands = [
[ "BMC nic_mode", "/updates/bmc nic_mode set dedicated", "/updates/bmc nic_mode get", "dedicated" ]
[ "BMC nic_mode", "/updates/bmc nic_mode set dedicated", "/updates/bmc nic_mode get", "dedicated", 10 ]
]

bmc_commands.each do |param|
ipmi_bmc_command "bmc #{param[0]}" do
command param[1]
test param[2]
value param[3]
settle_time param[4]
action :run
end
end
Expand Down

0 comments on commit 64986dd

Please sign in to comment.