mirror of https://github.com/Aidaho12/haproxy-wi
parent
48378c2022
commit
3300318616
|
@ -29,8 +29,7 @@ def action_haproxy(server_ip: str, action: str) -> None:
|
|||
if haproxy_enterprise == '1':
|
||||
haproxy_service_name = "hapee-2.0-lb"
|
||||
commands = [f"sudo systemctl {action} {haproxy_service_name}"]
|
||||
|
||||
server_mod.ssh_command(server_ip, commands)
|
||||
server_mod.ssh_command(server_ip, commands, timeout=5)
|
||||
roxywi_common.logging(server_ip, f'Service has been {action}ed', roxywi=1, login=1, keep_history=1, service='haproxy')
|
||||
print(f"success: HAProxy has been {action}")
|
||||
else:
|
||||
|
@ -56,7 +55,7 @@ def action_nginx(server_ip: str, action: str) -> None:
|
|||
commands = [f"sudo docker {action} {container_name}"]
|
||||
else:
|
||||
commands = [f"sudo systemctl {action} nginx"]
|
||||
server_mod.ssh_command(server_ip, commands)
|
||||
server_mod.ssh_command(server_ip, commands, timeout=5)
|
||||
roxywi_common.logging(server_ip, f'Service has been {action}ed', roxywi=1, login=1, keep_history=1, service='nginx')
|
||||
print(f"success: NGINX has been {action}")
|
||||
else:
|
||||
|
@ -96,7 +95,7 @@ def action_apache(server_ip: str, action: str) -> None:
|
|||
service_apache_name = service_common.get_correct_apache_service_name(None, server_id)
|
||||
|
||||
commands = [f"sudo systemctl {action} {service_apache_name}"]
|
||||
server_mod.ssh_command(server_ip, commands)
|
||||
server_mod.ssh_command(server_ip, commands, timeout=5)
|
||||
roxywi_common.logging(server_ip, f'Service has been {action}ed', roxywi=1, login=1, keep_history=1, service='apache')
|
||||
print(f"success: Apache has been {action}")
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ except Exception as e:
|
|||
roxywi_common.logging('Roxy-WI server', f'Cannot get a user plan: {e}', roxywi=1)
|
||||
|
||||
rendered_template = template.render(
|
||||
h2=1, role=user_params['role'], user=user_params['user'], users=users, groups=sql.select_groups(),
|
||||
role=user_params['role'], user=user_params['user'], users=users, groups=sql.select_groups(),
|
||||
servers=sql.select_servers(full=1), masters=masters, sshs=sql.select_ssh(), roles=sql.select_roles(),
|
||||
settings=settings, backups=sql.select_backups(), services=services, timezones=pytz.all_timezones,
|
||||
page="users.py", user_services=user_params['user_services'], ldap_enable=ldap_enable, gits=gits, guide_me=1,
|
||||
|
|
Loading…
Reference in New Issue