Permalink
Browse files

Update razor tftp configuration.

* Add undionly.kpxe file to support broadcom nics.
* Support changes to razor ipxe configuration ipaddress.

Conflicts:
	spec/classes/razor_spec.rb
  • Loading branch information...
1 parent 0f9355a commit 0520d37713a537cecc34a11064166dae48e9d393 Nan Liu committed Jul 12, 2012
@@ -51,6 +51,7 @@ Puppet master, add razor class to target node:
* username: razor daemon username, default: razor.
* directory; installation target directory, default: /opt/razor.
* ruby_version: ruby version, supports 1.8.7 and 1.9.3, default: 1.9.3.
+* address: razor.ipxe chain address, default: facter ipaddress.
class { 'razor':
directory => '/usr/local/razor',
View
Binary file not shown.
View
@@ -29,7 +29,8 @@
class razor (
$username = 'razor',
$directory = '/opt/razor',
- $ruby_version = '1.9.3'
+ $ruby_version = '1.9.3',
+ $address = $::ipaddress
){
include sudo
View
@@ -5,12 +5,16 @@
# Manages tftp service and files for razor.
#
class razor::tftp {
+
+ $address = $razor::address
+
include tftp
tftp::file { [ 'pxelinux.0',
'menu.c32',
'ipxe.iso',
- 'ipxe.lkrn' ]:
+ 'ipxe.lkrn',
+ 'undionly.kpxe' ]:
}
tftp::file { 'pxelinux.cfg':
View
@@ -10,7 +10,9 @@
context 'on Debian operatingsystems' do
let(:facts) do
{ :osfamily => 'Debian',
- :operatingsystem => 'Debian' }
+ :operatingsystem => 'Debian',
+ :ipaddress => '10.13.1.3'
+ }
end
it {
should include_class('mongodb')
@@ -19,6 +21,9 @@
:directory => params[:directory]
)
should include_class('razor::tftp')
+ should contain_file('/srv/tftp/razor.ipxe').with(
+ :content => /http:\/\/#{facts[:ipaddress]}:8026\/razor\/api\/boot\?hw_id=\$\{net0\/mac\}/
+ )
should include_class('razor::ruby')
should contain_user(params[:username]).with(
:ensure => 'present',
@@ -70,6 +75,9 @@
:directory => params[:directory]
)
should include_class('razor::tftp')
+ should contain_file('/var/lib/tftpboot/razor.ipxe').with(
+ :content => /http:\/\/#{facts[:ipaddress]}:8026\/razor\/api\/boot\?hw_id=\$\{net0\/mac\}/
+ )
should include_class('razor::ruby')
should contain_user(params[:username]).with(
:ensure => 'present',
@@ -28,9 +28,6 @@
should contain_file('/srv/tftp/ipxe.lkrn').with(
:source => 'puppet:///modules/razor/ipxe.lkrn'
)
- should contain_file('/srv/tftp/razor.ipxe').with(
- :content => /http:\/\/#{facts[:ipaddress]}:8026\/razor\/api\/boot\?hw_id=\$\{net0\/mac\}/
- )
}
end
@@ -61,9 +58,6 @@
should contain_file('/var/lib/tftpboot/ipxe.lkrn').with(
:source => 'puppet:///modules/razor/ipxe.lkrn'
)
- should contain_file('/var/lib/tftpboot/razor.ipxe').with(
- :content => /http:\/\/#{facts[:ipaddress]}:8026\/razor\/api\/boot\?hw_id=\$\{net0\/mac\}/
- )
}
end
@@ -94,9 +88,6 @@
should contain_file('/var/lib/tftpboot/ipxe.lkrn').with(
:source => 'puppet:///modules/razor/ipxe.lkrn'
)
- should contain_file('/var/lib/tftpboot/razor.ipxe').with(
- :content => /http:\/\/#{facts[:ipaddress]}:8026\/razor\/api\/boot\?hw_id=\$\{net0\/mac\}/
- )
}
end
end
View
@@ -9,7 +9,7 @@ isset ${net5/mac} && dhcp net5 ||
isset ${net6/mac} && dhcp net6 ||
isset ${net7/mac} && dhcp net7 ||
-chain http://<%= @ipaddress %>:8026/razor/api/boot?hw_id=${net0/mac}_${net1/mac}_${net2/mac}_${net3/mac}_${net4/mac}_${net5/mac}_${net6/mac}_${net7/mac} || goto error
+chain http://<%= @address %>:8026/razor/api/boot?hw_id=${net0/mac}_${net1/mac}_${net2/mac}_${net3/mac}_${net4/mac}_${net5/mac}_${net6/mac}_${net7/mac} || goto error
:error
sleep 15

0 comments on commit 0520d37

Please sign in to comment.