Last active
August 29, 2015 13:57
-
-
Save thoraxe/9789468 to your computer and use it in GitHub Desktop.
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
#!ipxe | |
# Example foreman_bootdisk generic host template | |
# | |
# This template is generic, but it will chainload to Foreman so expects the | |
# host to be registered already. | |
# | |
# It loops through all interfaces using DHCP, requesting a template from | |
# Foreman in the hope that one of the MACs or IPs matches. | |
# | |
# Copy this template to customize it, the original is read-only. | |
# loop over net* until we can get a template | |
:net0 | |
isset ${net0/mac} || goto no_nic | |
echo net0 is a ${net0/chip} with MAC ${net0/mac} | |
dhcp net0 || goto net1 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net0/mac} || goto net1 | |
exit 0 | |
:net1 | |
isset ${net1/mac} || goto no_nic | |
echo net1 is a ${net1/chip} with MAC ${net1/mac} | |
dhcp net1 || goto net2 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net1/mac} || goto net2 | |
exit 0 | |
:net2 | |
isset ${net2/mac} || goto no_nic | |
echo net2 is a ${net2/chip} with MAC ${net2/mac} | |
dhcp net2 || goto net3 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net2/mac} || goto net3 | |
exit 0 | |
:net3 | |
isset ${net3/mac} || goto no_nic | |
echo net3 is a ${net3/chip} with MAC ${net3/mac} | |
dhcp net3 || goto net4 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net3/mac} || goto net4 | |
exit 0 | |
:net4 | |
isset ${net4/mac} || goto no_nic | |
echo net4 is a ${net4/chip} with MAC ${net4/mac} | |
dhcp net4 || goto net5 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net4/mac} || goto net5 | |
exit 0 | |
:net5 | |
isset ${net5/mac} || goto no_nic | |
echo net5 is a ${net5/chip} with MAC ${net5/mac} | |
dhcp net5 || goto net6 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net5/mac} || goto net6 | |
exit 0 | |
:net6 | |
isset ${net6/mac} || goto no_nic | |
echo net6 is a ${net6/chip} with MAC ${net6/mac} | |
dhcp net6 || goto net7 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net6/mac} || goto net7 | |
exit 0 | |
:net7 | |
isset ${net7/mac} || goto no_nic | |
echo net7 is a ${net7/chip} with MAC ${net7/mac} | |
dhcp net7 || goto net8 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net7/mac} || goto net8 | |
exit 0 | |
:net8 | |
isset ${net8/mac} || goto no_nic | |
echo net8 is a ${net8/chip} with MAC ${net8/mac} | |
dhcp net8 || goto net9 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net8/mac} || goto net9 | |
exit 0 | |
:net9 | |
isset ${net9/mac} || goto no_nic | |
echo net9 is a ${net9/chip} with MAC ${net9/mac} | |
dhcp net9 || goto net10 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net9/mac} || goto net10 | |
exit 0 | |
:net10 | |
isset ${net10/mac} || goto no_nic | |
echo net10 is a ${net10/chip} with MAC ${net10/mac} | |
dhcp net10 || goto net11 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net10/mac} || goto net11 | |
exit 0 | |
:net11 | |
isset ${net11/mac} || goto no_nic | |
echo net11 is a ${net11/chip} with MAC ${net11/mac} | |
dhcp net11 || goto net12 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net11/mac} || goto net12 | |
exit 0 | |
:net12 | |
isset ${net12/mac} || goto no_nic | |
echo net12 is a ${net12/chip} with MAC ${net12/mac} | |
dhcp net12 || goto net13 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net12/mac} || goto net13 | |
exit 0 | |
:net13 | |
isset ${net13/mac} || goto no_nic | |
echo net13 is a ${net13/chip} with MAC ${net13/mac} | |
dhcp net13 || goto net14 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net13/mac} || goto net14 | |
exit 0 | |
:net14 | |
isset ${net14/mac} || goto no_nic | |
echo net14 is a ${net14/chip} with MAC ${net14/mac} | |
dhcp net14 || goto net15 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net14/mac} || goto net15 | |
exit 0 | |
:net15 | |
isset ${net15/mac} || goto no_nic | |
echo net15 is a ${net15/chip} with MAC ${net15/mac} | |
dhcp net15 || goto net16 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net15/mac} || goto net16 | |
exit 0 | |
:net16 | |
isset ${net16/mac} || goto no_nic | |
echo net16 is a ${net16/chip} with MAC ${net16/mac} | |
dhcp net16 || goto net17 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net16/mac} || goto net17 | |
exit 0 | |
:net17 | |
isset ${net17/mac} || goto no_nic | |
echo net17 is a ${net17/chip} with MAC ${net17/mac} | |
dhcp net17 || goto net18 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net17/mac} || goto net18 | |
exit 0 | |
:net18 | |
isset ${net18/mac} || goto no_nic | |
echo net18 is a ${net18/chip} with MAC ${net18/mac} | |
dhcp net18 || goto net19 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net18/mac} || goto net19 | |
exit 0 | |
:net19 | |
isset ${net19/mac} || goto no_nic | |
echo net19 is a ${net19/chip} with MAC ${net19/mac} | |
dhcp net19 || goto net20 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net19/mac} || goto net20 | |
exit 0 | |
:net20 | |
isset ${net20/mac} || goto no_nic | |
echo net20 is a ${net20/chip} with MAC ${net20/mac} | |
dhcp net20 || goto net21 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net20/mac} || goto net21 | |
exit 0 | |
:net21 | |
isset ${net21/mac} || goto no_nic | |
echo net21 is a ${net21/chip} with MAC ${net21/mac} | |
dhcp net21 || goto net22 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net21/mac} || goto net22 | |
exit 0 | |
:net22 | |
isset ${net22/mac} || goto no_nic | |
echo net22 is a ${net22/chip} with MAC ${net22/mac} | |
dhcp net22 || goto net23 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net22/mac} || goto net23 | |
exit 0 | |
:net23 | |
isset ${net23/mac} || goto no_nic | |
echo net23 is a ${net23/chip} with MAC ${net23/mac} | |
dhcp net23 || goto net24 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net23/mac} || goto net24 | |
exit 0 | |
:net24 | |
isset ${net24/mac} || goto no_nic | |
echo net24 is a ${net24/chip} with MAC ${net24/mac} | |
dhcp net24 || goto net25 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net24/mac} || goto net25 | |
exit 0 | |
:net25 | |
isset ${net25/mac} || goto no_nic | |
echo net25 is a ${net25/chip} with MAC ${net25/mac} | |
dhcp net25 || goto net26 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net25/mac} || goto net26 | |
exit 0 | |
:net26 | |
isset ${net26/mac} || goto no_nic | |
echo net26 is a ${net26/chip} with MAC ${net26/mac} | |
dhcp net26 || goto net27 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net26/mac} || goto net27 | |
exit 0 | |
:net27 | |
isset ${net27/mac} || goto no_nic | |
echo net27 is a ${net27/chip} with MAC ${net27/mac} | |
dhcp net27 || goto net28 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net27/mac} || goto net28 | |
exit 0 | |
:net28 | |
isset ${net28/mac} || goto no_nic | |
echo net28 is a ${net28/chip} with MAC ${net28/mac} | |
dhcp net28 || goto net29 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net28/mac} || goto net29 | |
exit 0 | |
:net29 | |
isset ${net29/mac} || goto no_nic | |
echo net29 is a ${net29/chip} with MAC ${net29/mac} | |
dhcp net29 || goto net30 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net29/mac} || goto net30 | |
exit 0 | |
:net30 | |
isset ${net30/mac} || goto no_nic | |
echo net30 is a ${net30/chip} with MAC ${net30/mac} | |
dhcp net30 || goto net31 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net30/mac} || goto net31 | |
exit 0 | |
:net31 | |
isset ${net31/mac} || goto no_nic | |
echo net31 is a ${net31/chip} with MAC ${net31/mac} | |
dhcp net31 || goto net32 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net31/mac} || goto net32 | |
exit 0 | |
:net32 | |
isset ${net32/mac} || goto no_nic | |
echo net32 is a ${net32/chip} with MAC ${net32/mac} | |
dhcp net32 || goto net33 | |
chain http://satellite.ejacobs.local/unattended/iPXE?token=44e95881-c5d1-4ee6-8f95-22a79b7c9645&mac=${net32/mac} || goto net33 | |
exit 0 | |
:no_nic | |
echo Failed to chainload from any network interface | |
sleep 30 | |
exit 1 |
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
Processing by UnattendedController#iPXE as HTML | |
Parameters: {"mac"=>"52:54:00:f4:33:11"} | |
Found client-14.ejacobs.local | |
Rendered inline template (32.1ms) | |
Completed 200 OK in 55ms (Views: 33.1ms | ActiveRecord: 10.6ms) | |
Processing by UnattendedController#iPXE as HTML | |
Parameters: {"token"=>"44e95881-c5d1-4ee6-8f95-22a79b7c9645", "mac"=>"52:54:00:f4:33:11"} | |
Found client-14.ejacobs.local | |
Rendered inline template (32.8ms) | |
Completed 200 OK in 59ms (Views: 33.3ms | ActiveRecord: 13.4ms) | |
Processing by UnattendedController#iPXE as HTML | |
Parameters: {"token"=>"44e95881-c5d1-4ee6-8f95-22a79b7c9645", "mac"=>"52:54:00:f4:33:11"} | |
Found client-14.ejacobs.local | |
Rendered inline template (37.2ms) | |
Completed 200 OK in 61ms (Views: 37.8ms | ActiveRecord: 10.6ms) | |
Processing by UnattendedController#iPXE as HTML | |
Parameters: {"token"=>"44e95881-c5d1-4ee6-8f95-22a79b7c9645", "mac"=>"52:54:00:f4:33:11"} | |
Found client-14.ejacobs.local | |
Rendered inline template (190.7ms) | |
Completed 200 OK in 207ms (Views: 191.5ms | ActiveRecord: 8.4ms) | |
Processing by UnattendedController#iPXE as HTML | |
Parameters: {"token"=>"44e95881-c5d1-4ee6-8f95-22a79b7c9645", "mac"=>"52:54:00:f4:33:11"} | |
Found client-14.ejacobs.local | |
Rendered inline template (30.4ms) | |
Completed 200 OK in 46ms (Views: 30.8ms | ActiveRecord: 6.7ms) | |
Processing by UnattendedController#iPXE as HTML | |
Parameters: {"token"=>"44e95881-c5d1-4ee6-8f95-22a79b7c9645", "mac"=>"52:54:00:f4:33:11"} | |
Found client-14.ejacobs.local | |
Rendered inline template (31.0ms) | |
Completed 200 OK in 65ms (Views: 35.7ms | ActiveRecord: 16.1ms) | |
Processing by UnattendedController#iPXE as HTML | |
Parameters: {"token"=>"44e95881-c5d1-4ee6-8f95-22a79b7c9645", "mac"=>"52:54:00:f4:33:11"} | |
Found client-14.ejacobs.local | |
Rendered inline template (31.1ms) | |
Completed 200 OK in 48ms (Views: 31.6ms | ActiveRecord: 7.5ms) | |
Processing by UnattendedController#iPXE as HTML | |
Parameters: {"token"=>"44e95881-c5d1-4ee6-8f95-22a79b7c9645", "mac"=>"52:54:00:f4:33:11"} | |
Found client-14.ejacobs.local | |
Rendered inline template (42.0ms) | |
Completed 200 OK in 71ms (Views: 42.5ms | ActiveRecord: 11.8ms) | |
Processing by UnattendedController#iPXE as HTML | |
Parameters: {"token"=>"44e95881-c5d1-4ee6-8f95-22a79b7c9645", "mac"=>"52:54:00:f4:33:11"} | |
Found client-14.ejacobs.local | |
Rendered inline template (222.5ms) | |
Completed 200 OK in 249ms (Views: 223.0ms | ActiveRecord: 11.1ms) | |
Processing by UnattendedController#iPXE as HTML | |
Parameters: {"token"=>"44e95881-c5d1-4ee6-8f95-22a79b7c9645", "mac"=>"52:54:00:f4:33:11"} | |
Found client-14.ejacobs.local | |
Rendered inline template (38.2ms) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment