diff --git a/src/inc/enc.php b/src/inc/enc.php index cac34d8ee94ea96f83f38cfe1f6696fcba6673b6..275034c9f1c54e975f4e347d9b1227df6b9bc5fc 100644 --- a/src/inc/enc.php +++ b/src/inc/enc.php @@ -549,7 +549,7 @@ function puppet_enc($con,$conf){ }else{ $qrole = 'controller'; } - $q = "SELECT machines.hostname AS hostname, machines.id AS nodeid, INET_NTOA(ips.ip) AS ipaddr FROM machines, ips, networks WHERE machines.role='$qrole' AND machines.id=ips.machine AND ips.network=networks.id AND networks.is_public='no' AND networks.role!='vm-net' AND networks.role!='ovs-bridge' AND networks.role!='ceph-cluster' AND networks.role!='ipmi'"; + $q = "SELECT machines.hostname AS hostname, machines.id AS nodeid, INET_NTOA(ips.ip) AS ipaddr FROM machines, ips, networks WHERE machines.role='$qrole' AND machines.cluster='$cluster_id' AND machines.id=ips.machine AND ips.network=networks.id AND networks.is_public='no' AND networks.role!='vm-net' AND networks.role!='ovs-bridge' AND networks.role!='ceph-cluster' AND networks.role!='ipmi'"; $r = mysqli_query($con, $q); if($r === FALSE){ $json["status"] = "error"; @@ -569,7 +569,7 @@ function puppet_enc($con,$conf){ $enc_non_master_sql = " non_master_sql:\n"; $enc_non_master_sql_ip = " non_master_sql_ip:\n"; - $q = "SELECT machines.hostname AS hostname, machines.id AS nodeid, INET_NTOA(ips.ip) AS ipaddr FROM machines, ips, networks WHERE machines.role='$qrole' AND machines.id=ips.machine AND ips.network=networks.id AND networks.is_public='no' AND networks.role!='vm-net' AND networks.role!='ovs-bridge' AND networks.role!='ceph-cluster' AND networks.role!='ipmi' AND machines.hostname!='$first_sql_hostname'"; + $q = "SELECT machines.hostname AS hostname, machines.id AS nodeid, INET_NTOA(ips.ip) AS ipaddr FROM machines, ips, networks WHERE machines.role='$qrole' AND machines.cluster='$cluster_id' AND machines.id=ips.machine AND ips.network=networks.id AND networks.is_public='no' AND networks.role!='vm-net' AND networks.role!='ovs-bridge' AND networks.role!='ceph-cluster' AND networks.role!='ipmi' AND machines.hostname!='$first_sql_hostname'"; $r = mysqli_query($con, $q); if($r === FALSE){ $json["status"] = "error"; diff --git a/src/inc/slave_actions.php b/src/inc/slave_actions.php index aa378e8de77c51893f6c07c413d6307ad10603a6..e98b03ef2142d130705a66671a4ae8355ca376ec 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){ diff --git a/src/inc/ssh.php b/src/inc/ssh.php index b4712f12dcece23ea2b3b6528d62d5f416c3526d..3b33bf9e35850e9e3a2529a423727b0a919b86a1 100644 --- a/src/inc/ssh.php +++ b/src/inc/ssh.php @@ -38,7 +38,7 @@ function scp_a_file($conf, $con, $ip_addr, $local_file, $remote_dest, $mode){ ssh2_scp_send($ssh, $local_file, $remote_dest, $mode); ssh2_disconnect($ssh); }else{ - $cmd = "scp -o \"StrictHostKeyChecking no\" -i /etc/openstack-cluster-installer/id_rsa $local_file root@$ip_addr:$remote_dest"; + $cmd = "scp -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null -o \"StrictHostKeyChecking no\" -i /etc/openstack-cluster-installer/id_rsa $local_file root@$ip_addr:$remote_dest"; $output = array(); $return_var = 0; exec($cmd, $output, $return_var); diff --git a/utils/usr/bin/oci-make-osd b/utils/usr/bin/oci-make-osd index d0ca95fa5559d5dbd0db17ea4c2e82c6fb589504..672fd04de93e5a7b5529cfce5c4685167fa09daa 100755 --- a/utils/usr/bin/oci-make-osd +++ b/utils/usr/bin/oci-make-osd @@ -26,7 +26,7 @@ chown ceph /etc/ceph/ceph.client.admin.keyring # - drive letter # - OSD id # - OSD port number -MAJOR_NUM=$(hostname -s | cut -d- -f3) +MAJOR_NUM=$(hostname -s | sed 's/^.*\-\([0-9]*\)$/\1/p;d' ) if echo ${HDD_DEV} | grep -q nvme ; then NVME_DRIVE_NUM=$(echo ${HDD_DEV} | sed sed -e s/nvme// -e s/n1//) # We add 1 to avoid issue when nvme0n1