2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-03 03:50:08 +00:00

Merge pull request #6280 from khm/xcatprobe-externaldns

xcatprobe xcatmn:  do not check DNS status on mn if site.externaldns=1
This commit is contained in:
xuweibj 2019-05-06 13:24:31 +08:00 committed by GitHub
commit cf99d8cc97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -957,13 +957,24 @@ sub check_dns_service {
my $nodename = `hostname -s 2>&1`;
chomp($nodename);
# For mn, 'externaldns' attribute could be set to '0' or '1' or not defined.
# if '1', mn does not need to provide DNS service, so will not check it.
# if '0' or undefined, proceed with check.
# For sn, 'setupdns' attribute could be set to '0' or '1'.
# if '0', sn does not need to provie DNS service, will not check it
# if '0', sn does not need to provide DNS service, will not check it
my $checkdns = 1;
if ($is_sn) {
$checkdns = `lsdef $nodename -i setupnameserver -c 2>&1| awk -F'=' '{print \$2}'`;
chomp($checkdns);
}
} else { # management node
my $dns_is_external = `lsdef -t site -i externaldns -c 2>&1 | awk -F'=' {print \$2}'`;
chomp($dns_is_external);
if ($dns_is_external eq "1") {
$checkdns = 0;
} else {
$checkdns = 1;
}
}
if ($checkdns) {
`which nslookup > /dev/null 2>&1`;