refs #407 #440 Adds new variable php fpm version to nginx template and adds installation to oglive 5.13 download
parent
c7fbea9231
commit
c5298f5322
|
@ -18,7 +18,7 @@ server {
|
||||||
# Bloque para manejar las solicitudes a index.php
|
# Bloque para manejar las solicitudes a index.php
|
||||||
location ~ ^/index.php(/|$) {
|
location ~ ^/index.php(/|$) {
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass unix:/run/php/php7.2-fpm.sock; # Asegúrate de que esto sea correcto
|
fastcgi_pass unix:/run/php/php__PHPVERSION__-fpm.sock; # Asegúrate de que esto sea correcto
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
|
|
@ -588,14 +588,19 @@ TFTP_OPTIONS="--secure"
|
||||||
logger.warning(f"Directory {TFTPCFGDIR} exist.")
|
logger.warning(f"Directory {TFTPCFGDIR} exist.")
|
||||||
#Descargar oglive
|
#Descargar oglive
|
||||||
logger.info("Downloading oglive...")
|
logger.info("Downloading oglive...")
|
||||||
#Temporalmente se copia desde ~/oglive
|
iso_name = "ogLive-focal-5.13.0-27-beta-amd64-r20210706.5b4bf5f.iso"
|
||||||
# copiar desde el montaje /mnt/srv/artefactos/ogboot/tftpboot/
|
try:
|
||||||
subprocess.run(["cp", "-r", f"/tmp/tftpboot/ogLive-5.11.0-r20210413", f"{TFTPCFGDIR}/"])
|
result = subprocess.run(
|
||||||
# subprocess.run(["cp", "-r", f"/tmp/ipxe/tftpboot/ipxe", f"{TFTPCFGDIR}/"])
|
["sudo", "/opt/ogboot/bin/oglivecli", "download", iso_name],
|
||||||
#Crear enlace simbólico de oglive-5.11.0-r20210413 a /var/lib/tftpboot/ogLive
|
check=True,
|
||||||
subprocess.run(["ln", "-s", f"{TFTPCFGDIR}/ogLive-5.11.0-r20210413", f"{TFTPCFGDIR}/ogLive"])
|
capture_output=True,
|
||||||
#Crear enlace simbólico de /var/lib/tftpboot/ogLive a /var/lib/tftpboot/ogLive/ogclient
|
text=True
|
||||||
subprocess.run(["ln", "-s", f"{TFTPCFGDIR}/ogLive", f"{TFTPCFGDIR}/ogclient"])
|
)
|
||||||
|
logger.info(f"oglivecli install output: {result.stdout}")
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
logger.error(f"Failed to install ogLive client: {e.stderr}")
|
||||||
|
logger.error("Continuing with the installation...")
|
||||||
|
|
||||||
symlink_target = f"{INSTALL_OGBOOT_TARGET}/tftpboot"
|
symlink_target = f"{INSTALL_OGBOOT_TARGET}/tftpboot"
|
||||||
logger.info(f"Creating symbolic link from {TFTPCFGDIR} to {symlink_target}")
|
logger.info(f"Creating symbolic link from {TFTPCFGDIR} to {symlink_target}")
|
||||||
if not os.path.exists(symlink_target):
|
if not os.path.exists(symlink_target):
|
||||||
|
@ -859,6 +864,7 @@ def setup_nginx():
|
||||||
try:
|
try:
|
||||||
# Obtener la IP del servidor
|
# Obtener la IP del servidor
|
||||||
ip_address_server = subprocess.check_output(["ifconfig", DEFAULTDEV]).decode().split("\n")[1].split()[1]
|
ip_address_server = subprocess.check_output(["ifconfig", DEFAULTDEV]).decode().split("\n")[1].split()[1]
|
||||||
|
php_version = get_php_fpm_version()
|
||||||
|
|
||||||
# Leer y modificar la plantilla de configuración de nginx
|
# Leer y modificar la plantilla de configuración de nginx
|
||||||
template_path = os.path.join(WORKDIR, "ogboot/etc/nginxServer.conf.tmpl")
|
template_path = os.path.join(WORKDIR, "ogboot/etc/nginxServer.conf.tmpl")
|
||||||
|
@ -866,6 +872,7 @@ def setup_nginx():
|
||||||
nginx_content = nginx_file.read()
|
nginx_content = nginx_file.read()
|
||||||
|
|
||||||
nginx_content = nginx_content.replace("__SERVERIP__", ip_address_server)
|
nginx_content = nginx_content.replace("__SERVERIP__", ip_address_server)
|
||||||
|
nginx_content = nginx_content.replace("__PHPVERSION__", php_version)
|
||||||
|
|
||||||
# Ruta de destino para la configuración de nginx
|
# Ruta de destino para la configuración de nginx
|
||||||
nginx_output = "/etc/nginx/sites-available/ogboot.conf"
|
nginx_output = "/etc/nginx/sites-available/ogboot.conf"
|
||||||
|
|
Loading…
Reference in New Issue