Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/profiles/install-coreos.ipxe
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set base-url <%=repo%>
# coreos.autologin <-- enable as kernel param to autologin for easier debugging
# reference: https://coreos.com/os/docs/latest/booting-with-ipxe.html
# JUST BOOT AND RUN COREOS
# kernel ${base-url}/<%=version%>/coreos_production_pxe.vmlinuz coreos.autologin cloud-config-url=http://<%=server%>:<%=port%>/api/current/templates/pxe-cloud-config.yml
# kernel ${base-url}/<%=version%>/coreos_production_pxe.vmlinuz coreos.autologin cloud-config-url=http://<%=server%>:<%=port%>/api/current/templates/pxe-cloud-config.yml?nodeId=<%=nodeId%>
#
kernel ${base-url}/<%=version%>/coreos_production_pxe.vmlinuz console=tty0 console=<%=comport%>,115200n8 coreos.autologin cloud-config-url=<%=installScriptUri%>
initrd ${base-url}/<%=version%>/coreos_production_pxe_image.cpio.gz
Expand Down
2 changes: 1 addition & 1 deletion data/profiles/install-esx60.ipxe
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
set 209:string http://<%=server%>:<%=port%>/api/current/templates/esx60-pxelinux-cfg
set 209:string http://<%=server%>:<%=port%>/api/current/templates/esx60-pxelinux-cfg?nodeId=<%=nodeId%>
chain tftp://<%=server%>/undionly.kkpxe
3 changes: 2 additions & 1 deletion data/profiles/rancherOS.ipxe
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
kernel <%=kernelUri%>
initrd <%=initrdUri%>
imgargs <%=kernelFile%> initrd=<%=initrdFile%> console=tty0 rancher.password=root rancher.cloud_init.datasources=['url:http://<%=server%>:<%=port%>/api/common/templates/cloud-config.yaml']
imgargs <%=kernelFile%> initrd=<%=initrdFile%> console=tty0 rancher.password=root rancher.cloud_init.datasources=['url:http://<%=server%>:<%=port%>/api/current/templates/cloud-config.yaml?nodeId=<%=nodeId%>']
boot || prompt --key 0x197e --timeout 2000 Press F12 to investigate || exit shell

10 changes: 4 additions & 6 deletions data/profiles/taskrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ def download_script(_downloadUrl):
"""
Download a python script from downloadUrl
"""
url = urllib2.urlparse.urljoin('http://<%=server%>:<%=port%>', _downloadUrl)
poc_log("Downloading script at {}".format(url))
script = urllib2.urlopen(url).read()
poc_log("Downloading script at {}".format(_downloadUrl))
script = urllib2.urlopen(_downloadUrl).read()
poc_log("{0}".format(script))
with open('script.py', 'w') as rackhd_script:
rackhd_script.write(script)
Expand Down Expand Up @@ -74,9 +73,8 @@ def download_script(_downloadUrl):
Download a python script from downloadUrl
"""
session = requests.Session()
url = 'http://<%=server%>:<%=port%>' + _downloadUrl
poc_log("Downloading script at {}".format(url))
script = session.get(url, auth=("", ""))
poc_log("Downloading script at {}".format(_downloadUrl))
script = session.get(_downloadUrl, auth=("", ""))
session.close()
poc_log("{0}".format(script))
with open('script.py', 'w') as rackhd_script:
Expand Down
4 changes: 2 additions & 2 deletions data/profiles/zerotouch-configure.zt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/Cli -p2
enable
echo "STARTING RENASAR ZEROTOUCH"
copy http://<%=server%>:<%=port%>/api/current/templates/<%=startupConfig%> flash:startup-config
copy http://<%=server%>:<%=port%>/api/current/templates/<%=bootConfig%> flash:boot-config
copy http://<%=server%>:<%=port%>/api/current/templates/<%=startupConfig%>?nodeId=<%=nodeId%> flash:startup-config
copy http://<%=server%>:<%=port%>/api/current/templates/<%=bootConfig%>?nodeId=<%=nodeId%> flash:boot-config
copy http://<%=server%>:<%=port%>/<%=eosImage%> flash:
echo "RENASAR ZEROTOUCH FINISHED"
exit
11 changes: 4 additions & 7 deletions data/templates/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"use strict";

var http = require('http'),
url = require('url'),
fs = require('fs'),
path = require('path'),
childProcess = require('child_process'),
Expand Down Expand Up @@ -232,13 +233,9 @@ function getTasks(timeout) {
* @param cb
*/
function getFile(downloadUrl, cb) {
http.request({
hostname: server,
port: port,
path: downloadUrl,
method: 'GET'
}, function (res) {
var filename = path.basename(downloadUrl);
var urlObj = url.parse(downloadUrl);
http.request(urlObj, function (res) {
var filename = path.basename(urlObj.pathname);
var stream = fs.createWriteStream(filename);

res.on('end', function () {
Expand Down
2 changes: 1 addition & 1 deletion data/templates/centos-ks
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export PATH
<% } %>

# Download the service to callback to RackHD after OS installation/reboot completion
/usr/bin/wget http://<%=server%>:<%=port%>/api/current/templates/<%=rackhdCallbackScript%> -O /etc/rc.d/init.d/<%=rackhdCallbackScript%>
/usr/bin/wget http://<%=server%>:<%=port%>/api/current/templates/<%=rackhdCallbackScript%>?nodeId=<%=nodeId%> -O /etc/rc.d/init.d/<%=rackhdCallbackScript%>
chmod +x /etc/rc.d/init.d/<%=rackhdCallbackScript%>
# Enable the above service, it should auto-disable after running once
chkconfig <%=rackhdCallbackScript%> on
Expand Down
2 changes: 1 addition & 1 deletion data/templates/esx-boot-cfg-http
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bootstate=0
title=Loading ESXi installer
kernel=http://<%=server%>:<%=port%>/vmware/tboot.b00
kernelopt=runweasel formatwithmbr com1_baud=115200 com1_Port=<%=comportaddress%> tty2Port=<%=comport%> debugLogToSerial=1 logPort=<%=comport%> ks=http://<%=server%>:<%=port%>/api/current/templates/esx-ks <%=kargs%>
kernelopt=runweasel formatwithmbr com1_baud=115200 com1_Port=<%=comportaddress%> tty2Port=<%=comport%> debugLogToSerial=1 logPort=<%=comport%> ks=http://<%=server%>:<%=port%>/api/current/templates/esx-ks?nodeId=<%=nodeId%> <%=kargs%>
modules=http://<%=server%>:<%=port%>/vmware/b.b00 --- http://<%=server%>:<%=port%>/vmware/jumpstrt.gz --- http://<%=server%>:<%=port%>/vmware/useropts.gz --- http://<%=server%>:<%=port%>/vmware/k.b00 --- http://<%=server%>:<%=port%>/vmware/chardevs.b00 --- http://<%=server%>:<%=port%>/vmware/a.b00 --- http://<%=server%>:<%=port%>/vmware/user.b00 --- http://<%=server%>:<%=port%>/vmware/sb.v00 --- http://<%=server%>:<%=port%>/vmware/s.v00 --- http://<%=server%>:<%=port%>/vmware/ata_pata.v00 --- http://<%=server%>:<%=port%>/vmware/ata_pata.v01 --- http://<%=server%>:<%=port%>/vmware/ata_pata.v02 --- http://<%=server%>:<%=port%>/vmware/ata_pata.v03 --- http://<%=server%>:<%=port%>/vmware/ata_pata.v04 --- http://<%=server%>:<%=port%>/vmware/ata_pata.v05 --- http://<%=server%>:<%=port%>/vmware/ata_pata.v06 --- http://<%=server%>:<%=port%>/vmware/ata_pata.v07 --- http://<%=server%>:<%=port%>/vmware/block_cc.v00 --- http://<%=server%>:<%=port%>/vmware/ehci_ehc.v00 --- http://<%=server%>:<%=port%>/vmware/elxnet.v00 --- http://<%=server%>:<%=port%>/vmware/weaselin.t00 --- http://<%=server%>:<%=port%>/vmware/esx_dvfi.v00 --- http://<%=server%>:<%=port%>/vmware/xlibs.v00 --- http://<%=server%>:<%=port%>/vmware/ima_qla4.v00 --- http://<%=server%>:<%=port%>/vmware/ipmi_ipm.v00 --- http://<%=server%>:<%=port%>/vmware/ipmi_ipm.v01 --- http://<%=server%>:<%=port%>/vmware/ipmi_ipm.v02 --- http://<%=server%>:<%=port%>/vmware/lpfc.v00 --- http://<%=server%>:<%=port%>/vmware/lsi_mr3.v00 --- http://<%=server%>:<%=port%>/vmware/lsi_msgp.v00 --- http://<%=server%>:<%=port%>/vmware/misc_cni.v00 --- http://<%=server%>:<%=port%>/vmware/misc_dri.v00 --- http://<%=server%>:<%=port%>/vmware/mtip32xx.v00 --- http://<%=server%>:<%=port%>/vmware/net_be2n.v00 --- http://<%=server%>:<%=port%>/vmware/net_bnx2.v00 --- http://<%=server%>:<%=port%>/vmware/net_bnx2.v01 --- http://<%=server%>:<%=port%>/vmware/net_cnic.v00 --- http://<%=server%>:<%=port%>/vmware/net_e100.v00 --- http://<%=server%>:<%=port%>/vmware/net_enic.v00 --- http://<%=server%>:<%=port%>/vmware/net_forc.v00 --- http://<%=server%>:<%=port%>/vmware/net_igb.v00 --- http://<%=server%>:<%=port%>/vmware/net_ixgb.v00 --- http://<%=server%>:<%=port%>/vmware/net_mlx4.v00 --- http://<%=server%>:<%=port%>/vmware/net_mlx4.v01 --- http://<%=server%>:<%=port%>/vmware/net_nx_n.v00 --- http://<%=server%>:<%=port%>/vmware/net_tg3.v00 --- http://<%=server%>:<%=port%>/vmware/net_vmxn.v00 --- http://<%=server%>:<%=port%>/vmware/ohci_usb.v00 --- http://<%=server%>:<%=port%>/vmware/qlnative.v00 --- http://<%=server%>:<%=port%>/vmware/rste.v00 --- http://<%=server%>:<%=port%>/vmware/sata_ahc.v00 --- http://<%=server%>:<%=port%>/vmware/sata_ata.v00 --- http://<%=server%>:<%=port%>/vmware/sata_sat.v00 --- http://<%=server%>:<%=port%>/vmware/sata_sat.v01 --- http://<%=server%>:<%=port%>/vmware/sata_sat.v02 --- http://<%=server%>:<%=port%>/vmware/sata_sat.v03 --- http://<%=server%>:<%=port%>/vmware/sata_sat.v04 --- http://<%=server%>:<%=port%>/vmware/scsi_aac.v00 --- http://<%=server%>:<%=port%>/vmware/scsi_adp.v00 --- http://<%=server%>:<%=port%>/vmware/scsi_aic.v00 --- http://<%=server%>:<%=port%>/vmware/scsi_bnx.v00 --- http://<%=server%>:<%=port%>/vmware/scsi_bnx.v01 --- http://<%=server%>:<%=port%>/vmware/scsi_fni.v00 --- http://<%=server%>:<%=port%>/vmware/scsi_hps.v00 --- http://<%=server%>:<%=port%>/vmware/scsi_ips.v00 --- http://<%=server%>:<%=port%>/vmware/scsi_lpf.v00 --- http://<%=server%>:<%=port%>/vmware/scsi_meg.v00 --- http://<%=server%>:<%=port%>/vmware/scsi_meg.v01 --- http://<%=server%>:<%=port%>/vmware/scsi_meg.v02 --- http://<%=server%>:<%=port%>/vmware/scsi_mpt.v00 --- http://<%=server%>:<%=port%>/vmware/scsi_mpt.v01 --- http://<%=server%>:<%=port%>/vmware/scsi_mpt.v02 --- http://<%=server%>:<%=port%>/vmware/scsi_qla.v00 --- http://<%=server%>:<%=port%>/vmware/scsi_qla.v01 --- http://<%=server%>:<%=port%>/vmware/uhci_usb.v00 --- http://<%=server%>:<%=port%>/vmware/tools.t00 --- http://<%=server%>:<%=port%>/vmware/xorg.v00 --- http://<%=server%>:<%=port%>/vmware/net-e100.t00 --- http://<%=server%>:<%=port%>/vmware/net-e100.t01 --- http://<%=server%>:<%=port%>/vmware/sata-xah.t00 --- http://<%=server%>:<%=port%>/vmware/payload1.v00 --- http://<%=server%>:<%=port%>/vmware/imgdb.tgz --- http://<%=server%>:<%=port%>/vmware/imgpayld.tgz
build=
updated=0
2 changes: 1 addition & 1 deletion data/templates/esx-boot-cfg-tftp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bootstate=0
title=Loading ESXi installer
kernel=tftp://<%=server%>/vmware/tboot.b00
kernelopt=runweasel formatwithmbr com1_baud=115200 com1_Port=<%=comportaddress%> tty2Port=<%=comport%> debugLogToSerial=1 logPort=<%=comport%> ks=http://<%=server%>:<%=port%>/api/current/templates/esx-ks <%=kargs%>
kernelopt=runweasel formatwithmbr com1_baud=115200 com1_Port=<%=comportaddress%> tty2Port=<%=comport%> debugLogToSerial=1 logPort=<%=comport%> ks=http://<%=server%>:<%=port%>/api/current/templates/esx-ks?nodeId=<%=nodeId%> <%=kargs%>
modules=tftp://<%=server%>/vmware/b.b00 --- tftp://<%=server%>/vmware/jumpstrt.gz --- tftp://<%=server%>/vmware/useropts.gz --- tftp://<%=server%>/vmware/k.b00 --- tftp://<%=server%>/vmware/chardevs.b00 --- tftp://<%=server%>/vmware/a.b00 --- tftp://<%=server%>/vmware/user.b00 --- tftp://<%=server%>/vmware/sb.v00 --- tftp://<%=server%>/vmware/s.v00 --- tftp://<%=server%>/vmware/ata_pata.v00 --- tftp://<%=server%>/vmware/ata_pata.v01 --- tftp://<%=server%>/vmware/ata_pata.v02 --- tftp://<%=server%>/vmware/ata_pata.v03 --- tftp://<%=server%>/vmware/ata_pata.v04 --- tftp://<%=server%>/vmware/ata_pata.v05 --- tftp://<%=server%>/vmware/ata_pata.v06 --- tftp://<%=server%>/vmware/ata_pata.v07 --- tftp://<%=server%>/vmware/block_cc.v00 --- tftp://<%=server%>/vmware/ehci_ehc.v00 --- tftp://<%=server%>/vmware/elxnet.v00 --- tftp://<%=server%>/vmware/weaselin.t00 --- tftp://<%=server%>/vmware/esx_dvfi.v00 --- tftp://<%=server%>/vmware/xlibs.v00 --- tftp://<%=server%>/vmware/ima_qla4.v00 --- tftp://<%=server%>/vmware/ipmi_ipm.v00 --- tftp://<%=server%>/vmware/ipmi_ipm.v01 --- tftp://<%=server%>/vmware/ipmi_ipm.v02 --- tftp://<%=server%>/vmware/lpfc.v00 --- tftp://<%=server%>/vmware/lsi_mr3.v00 --- tftp://<%=server%>/vmware/lsi_msgp.v00 --- tftp://<%=server%>/vmware/misc_cni.v00 --- tftp://<%=server%>/vmware/misc_dri.v00 --- tftp://<%=server%>/vmware/mtip32xx.v00 --- tftp://<%=server%>/vmware/net_be2n.v00 --- tftp://<%=server%>/vmware/net_bnx2.v00 --- tftp://<%=server%>/vmware/net_bnx2.v01 --- tftp://<%=server%>/vmware/net_cnic.v00 --- tftp://<%=server%>/vmware/net_e100.v00 --- tftp://<%=server%>/vmware/net_enic.v00 --- tftp://<%=server%>/vmware/net_forc.v00 --- tftp://<%=server%>/vmware/net_igb.v00 --- tftp://<%=server%>/vmware/net_ixgb.v00 --- tftp://<%=server%>/vmware/net_mlx4.v00 --- tftp://<%=server%>/vmware/net_mlx4.v01 --- tftp://<%=server%>/vmware/net_nx_n.v00 --- tftp://<%=server%>/vmware/net_tg3.v00 --- tftp://<%=server%>/vmware/net_vmxn.v00 --- tftp://<%=server%>/vmware/ohci_usb.v00 --- tftp://<%=server%>/vmware/qlnative.v00 --- tftp://<%=server%>/vmware/rste.v00 --- tftp://<%=server%>/vmware/sata_ahc.v00 --- tftp://<%=server%>/vmware/sata_ata.v00 --- tftp://<%=server%>/vmware/sata_sat.v00 --- tftp://<%=server%>/vmware/sata_sat.v01 --- tftp://<%=server%>/vmware/sata_sat.v02 --- tftp://<%=server%>/vmware/sata_sat.v03 --- tftp://<%=server%>/vmware/sata_sat.v04 --- tftp://<%=server%>/vmware/scsi_aac.v00 --- tftp://<%=server%>/vmware/scsi_adp.v00 --- tftp://<%=server%>/vmware/scsi_aic.v00 --- tftp://<%=server%>/vmware/scsi_bnx.v00 --- tftp://<%=server%>/vmware/scsi_bnx.v01 --- tftp://<%=server%>/vmware/scsi_fni.v00 --- tftp://<%=server%>/vmware/scsi_hps.v00 --- tftp://<%=server%>/vmware/scsi_ips.v00 --- tftp://<%=server%>/vmware/scsi_lpf.v00 --- tftp://<%=server%>/vmware/scsi_meg.v00 --- tftp://<%=server%>/vmware/scsi_meg.v01 --- tftp://<%=server%>/vmware/scsi_meg.v02 --- tftp://<%=server%>/vmware/scsi_mpt.v00 --- tftp://<%=server%>/vmware/scsi_mpt.v01 --- tftp://<%=server%>/vmware/scsi_mpt.v02 --- tftp://<%=server%>/vmware/scsi_qla.v00 --- tftp://<%=server%>/vmware/scsi_qla.v01 --- tftp://<%=server%>/vmware/uhci_usb.v00 --- tftp://<%=server%>/vmware/tools.t00 --- tftp://<%=server%>/vmware/xorg.v00 --- tftp://<%=server%>/vmware/net-e100.t00 --- tftp://<%=server%>/vmware/net-e100.t01 --- tftp://<%=server%>/vmware/sata-xah.t00 --- tftp://<%=server%>/vmware/payload1.v00 --- tftp://<%=server%>/vmware/imgdb.tgz --- tftp://<%=server%>/vmware/imgpayld.tgz
build=
updated=0
31 changes: 1 addition & 30 deletions data/templates/esx-ks
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,6 @@ reboot

%firstboot --interpreter=busybox

postLookup () {
echo "Attempting postLookup operation on $1" >> /vmfs/volumes/datastore1/firstboot.log
mac=`esxcli --debug --formatter=csv network ip interface list | grep $1 | awk -F, '{print $3}'`
if [ "<%=version%>" == "5.5" ]; then
mac=`esxcli --debug --formatter=csv network ip interface list | grep $1 | awk -F, '{print $2}'`
fi
BODY="{"
BODY=$BODY"\"macAddress\": \"$mac\","
BODY=$BODY"\"ipAddress\": \"$2\","
BODY=$BODY"\"node\": \"<%=nodeId%>\""
BODY=$BODY"}"
BODYLEN=$(echo -n ${BODY} | wc -c )
echo ${BODY} >> /vmfs/volumes/datastore1/firstboot.log
result=`echo -ne "POST /api/current/lookups HTTP/1.0\r\nHost: $2\r\nContent-Type: application/json\r\nContent-Length: ${BODYLEN}\r\n\r\n${BODY}" | nc -i 3 <%=server%> <%=port%> | grep -oE 'HTTP/1.1 [0-9]{3}' | awk '{print $2}'`
if [ "$result" -ge "400" ]; then
# Make an attempt to PATCH if we can find the node id. This is to handle the case where the
# ARP poller added the lookup entry when we tried to POST above causing a collision.
id=`wget http://<%=server%>:<%=port%>/api/current/lookups?q=$2 -qO - | grep -oE '\"id\":\"(.)*\"'`
if [ "$?" -eq "0" ]; then
id=`echo $id | awk -F: '{gsub(/"/,"",$2); print $2}'`
result=`echo -ne "PATCH /api/current/lookups/$id HTTP/1.0\r\nHost: $2\r\nContent-Type: application/json\r\nContent-Length: ${BODYLEN}\r\n\r\n${BODY}" | nc -i 3 <%=server%> <%=port%> | grep -oE 'HTTP/1.1 [0-9]{3}' | awk '{print $2}'`
echo "Patch result: $result to id: $id" >> /vmfs/volumes/datastore1/firstboot.log
fi
fi
wget http://<%=server%>:<%=port%>/api/current/lookups?q=$2 -qO - >> /vmfs/volumes/datastore1/firstboot.log
}

# enable VHV (Virtual Hardware Virtualization to run nested 64bit Guests + Hyper-V VM)
grep -i "vhv.enable" /etc/vmware/config || echo "vhv.enable = \"TRUE\"" >> /etc/vmware/config

Expand Down Expand Up @@ -172,7 +145,6 @@ cp /var/log/esxi_install.log "/vmfs/volumes/datastore1/firstboot-esxi_install.lo
esxcli network ip interface ipv4 set -i <%=vmkname%> -I <%=n.ipv4.ipAddr%> -N <%=n.ipv4.netmask%> -t static
esxcli network ip route ipv4 add -n default -g <%=n.ipv4.gateway%>
esxcli network vswitch standard portgroup set -p $currdev.<%=vid%> -v <%=vid %>
postLookup <%=vmkname%> <%=n.ipv4.ipAddr%>
<% }); %>
<% } else { %>
<% vmkname = 'vmk' + vmkid++ %>
Expand All @@ -181,7 +153,6 @@ cp /var/log/esxi_install.log "/vmfs/volumes/datastore1/firstboot-esxi_install.lo
esxcli network ip interface add -i <%=vmkname%> -p $currdev
esxcli network ip interface ipv4 set -i <%=vmkname%> -I <%=n.ipv4.ipAddr%> -N <%=n.ipv4.netmask%> -t static
esxcli network ip route ipv4 add -n default -g <%=n.ipv4.gateway%>
postLookup <%=vmkname%> <%=n.ipv4.ipAddr%>
<% } %>
<% } %>
<% if( undefined !== n.ipv6 ) { %>
Expand Down Expand Up @@ -238,7 +209,7 @@ cp /var/log/esxi_install.log "/vmfs/volumes/datastore1/firstboot-esxi_install.lo
#
# NOTE: this script will execute right away as a result of writing it to local.sh
# along with executing on every subsequent boot
wget http://<%=server%>:<%=port%>/api/current/templates/<%=rackhdCallbackScript%> -O /etc/rc.local.d/local.sh
wget http://<%=server%>:<%=port%>/api/current/templates/<%=rackhdCallbackScript%>?nodeId=<%=nodeId%> -O /etc/rc.local.d/local.sh

#backup ESXi configuration to persist it
/sbin/auto-backup.sh
Expand Down
2 changes: 1 addition & 1 deletion data/templates/esx-pxelinux-cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ PROMPT 0
TIMEOUT 80
LABEL install
KERNEL <%=repo%>/<%=mbootFile%>
APPEND -c http://<%=server%>:<%=port%>/api/current/templates/<%=esxBootConfigTemplate%>
APPEND -c http://<%=server%>:<%=port%>/api/current/templates/<%=esxBootConfigTemplate%>?nodeId=<%=nodeId%>
5 changes: 3 additions & 2 deletions data/templates/install-coreos.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
set -e
curl -O http://<%=server%>:<%=port%>/api/current/templates/pxe-cloud-config.yml
sudo coreos-install -d <%=installDisk%> -c pxe-cloud-config.yml -b <%=repo%>
CLOUD_CONFIG_FILE=pxe-cloud-config.yml
curl -o $CLOUD_CONFIG_FILE http://<%=server%>:<%=port%>/api/current/templates/$CLOUD_CONFIG_FILE?nodeId=<%=nodeId%>
sudo coreos-install -d <%=installDisk%> -c $CLOUD_CONFIG_FILE -b <%=repo%>
curl -X POST -H 'Content-Type:application/json' http://<%=server%>:<%=port%>/api/current/notification?nodeId=<%=nodeId%>
sudo reboot
4 changes: 2 additions & 2 deletions data/templates/install-photon/photon-os-ks
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
"#!/bin/sh",

"# Set the configuration",
"/bin/curl http://<%=server%>:<%=port%>/api/current/templates/post-install-photon.sh > /tmp/post-install-photon.sh",
"/bin/curl http://<%=server%>:<%=port%>/api/current/templates/post-install-photon.sh?nodeId=<%=nodeId%> > /tmp/post-install-photon.sh",
"chmod +x /tmp/post-install-photon.sh",
"./tmp/post-install-photon.sh 2>&1 > /root/post-install-photon.log",

"# Download the service to callback to RackHD after OS installation/reboot completion",
"/bin/curl http://<%=server%>:<%=port%>/api/current/templates/<%=rackhdCallbackScript%> > /etc/<%=rackhdCallbackScript%>",
"/bin/curl http://<%=server%>:<%=port%>/api/current/templates/<%=rackhdCallbackScript%>?nodeId=<%=nodeId%> > /etc/<%=rackhdCallbackScript%>",
"chmod +x /etc/<%=rackhdCallbackScript%>",

"# Generate the service file",
Expand Down
8 changes: 4 additions & 4 deletions data/templates/install-ubuntu/ubuntu-preseed
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ in-target vconfig add ip.device <%=vid%>; \
<%_ } _%>
<%_ } _%>
<%_ }); _%>
wget http://<%=server%>:<%=port%>/api/current/templates/ubuntu-interfaces -O /etc/network/interfaces; \
wget http://<%=server%>:<%=port%>/api/current/templates/ubuntu-interfaces?nodeId=<%=nodeId%> -O /etc/network/interfaces; \
<%_ } _%>
in-target wget http://<%=server%>:<%=port%>/api/current/templates/post-install-ubuntu.sh -O ./post-install.sh; \
in-target wget http://<%=server%>:<%=port%>/api/current/templates/post-install-ubuntu.sh?nodeId=<%=nodeId%> -O ./post-install.sh; \
in-target chmod +x ./post-install.sh; \
in-target ./post-install.sh; \
in-target wget http://<%=server%>:<%=port%>/api/current/templates/ubuntu-sources -O /etc/apt/sources.list; \
in-target wget http://<%=server%>:<%=port%>/api/current/templates/<%=rackhdCallbackScript%> -O /etc/rc2.d/S99callback; \
in-target wget http://<%=server%>:<%=port%>/api/current/templates/ubuntu-sources?nodeId=<%=nodeId%> -O /etc/apt/sources.list; \
in-target wget http://<%=server%>:<%=port%>/api/current/templates/<%=rackhdCallbackScript%>?nodeId=<%=nodeId%> -O /etc/rc2.d/S99callback; \
in-target chmod +x /etc/rc2.d/S99callback; \
in-target curl -X POST -H 'Content-Type:application/json' http://<%=server%>:<%=port%>/api/current/notification?nodeId=<%=nodeId%>
Loading