refs #1149 removes port from tftp ip in embed script, changes default values in config.json

ogboot-log
Luis Gerardo Romero Garcia 2024-11-14 15:32:37 +01:00
parent 842e5c9b95
commit 6cdde68206
2 changed files with 7 additions and 5 deletions

View File

@ -1,8 +1,8 @@
{
"ogCore_ServerIP": "172.17.8.82",
"ogBoot_ServerIP": "172.17.8.37",
"ogCore_ServerIP": "172.17.8.82:8081",
"ogBoot_ServerIP": "172.17.8.37:8082",
"ogBoot_Dir": "/opt/opengnsys/ogboot",
"ogLive_Default": "https://ognproject.evlt.uma.es/oglive//ogLive-noble-6.8.0-31-generic-amd64-r20241024.8100be23_20241112.iso",
"ogLive_Default": "https://ognproject.evlt.uma.es/oglive//ogLive-noble-6.8.0-31-generic-amd64-r20241017.76908e62_20241113.iso",
"ogBootSambaUser": "opengnsys",
"ogBootSambaPass": "og"
}

View File

@ -566,13 +566,15 @@ def get_ip_address(interface):
def generate_ipxe_script():
ip_address_server = OGBOOT_IP
ip_address = re.match(r"^(.*?):", ip_address_server)
ip_address = ip_address.group(1) if ip_address else ip_address_server
template = os.path.join(REPO_DIR, "etc/dhcp_boot.ipxe.tmpl")
ipxe_output = f"{INSTALL_OGBOOT_TARGET}/tftpboot/ipxe_scripts/dhcp_boot.ipxe"
os.makedirs(os.path.dirname(ipxe_output), mode=0o775, exist_ok=True)
#shutil.copy(template, ipxe_output)
with open(template, "r") as ipxe_file:
ipxe_content = ipxe_file.read()
ipxe_content = ipxe_content.replace("__SERVERIP__", ip_address_server)
ipxe_content = ipxe_content.replace("__SERVERIP__", ip_address)
with open(ipxe_output, "w") as ipxe_file:
ipxe_file.write(ipxe_content)
@ -580,7 +582,7 @@ def generate_ipxe_script():
default_output = os.path.join(INSTALL_OGBOOT_TARGET, "tftpboot/ipxe_scripts/default.ipxe")
with open(template_default, "r") as default_tmpl_file:
default_template_content = default_tmpl_file.read()
default_ipxe_content = default_template_content.replace("__SERVERIP__", ip_address_server)
default_ipxe_content = default_template_content.replace("__SERVERIP__", ip_address)
with open(default_output, "w") as default_ipxe_file:
default_ipxe_file.write(default_ipxe_content)
logger.info("ipxe files created correctly.")