From fdd7d017a7a8d7d45072955606c439f17bd76074 Mon Sep 17 00:00:00 2001 From: Erwan MAS Date: Mon, 22 Jun 2020 19:15:52 +0000 Subject: [PATCH] we need to order by the network , so all hosts in the /etc/hosts/ will be in the same networks --- src/inc/slave_actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inc/slave_actions.php b/src/inc/slave_actions.php index c0f530d2..2481c00f 100644 --- a/src/inc/slave_actions.php +++ b/src/inc/slave_actions.php @@ -1341,7 +1341,7 @@ $pxe_server_ipaddr $pxe_server_hostname $other_host_hostname = str_replace("." . $cluster_domain, "", $other_host_fqdn); $other_host_id = $other_host["id"]; - $q_oh = "SELECT INET_NTOA(ips.ip) AS addr FROM networks, ips WHERE ips.machine='$other_host_id' AND networks.cluster='$machine_cluster' AND networks.id=ips.network LIMIT 1"; + $q_oh = "SELECT INET_NTOA(ips.ip) AS addr FROM networks, ips WHERE ips.machine='$other_host_id' AND networks.cluster='$machine_cluster' AND networks.id=ips.network order by case when role='all' then 1 when role='vm-net' then 2 when role='ceph-cluster' then 3 else 9 end LIMIT 1"; $r_oh = mysqli_query($con, $q_oh); $n_oh = mysqli_num_rows($r_oh); if($n_oh == 1){ -- GitLab