2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-13 01:40:26 +00:00

Configure Cumulus switch via switchdiscover --setup options (#3375)

This commit is contained in:
cxhong
2017-07-10 23:17:15 -04:00
committed by yangsong
parent 3b0f7b7852
commit 59738f65f9
2 changed files with 20 additions and 7 deletions

View File

@ -1428,7 +1428,9 @@ sub switchsetup {
if (-r -x $config_script) {
my $switches = join(",",@{${nodes_to_config}->{$mytype}});
if ($mytype eq "onie") {
send_msg($request, 0, "onie switch needs to take 50 mins to install, please run /opt/xcat/share/xcat/script/configonie after Cumulus OS installed on switch\n");
send_msg($request, 0, "Call to config $switches\n");
my $out = `$config_script --switches $switches --all`;
send_msg($request, 0, "output = $out\n");
} else {
send_msg($request, 0, "call to config $mytype switches $switches\n");
my $out = `$config_script --switches $switches --all`;

View File

@ -99,16 +99,17 @@ if (($::SSH) || ($::ALL))
config_ssh();
}
if (($::LICENSE) || ($::ALL))
if ($::LICENSE)
{
install_license();
}
if (($::SNMP) || ($::ALL))
if ($::SNMP)
{
config_snmp();
}
if (($::NTP) || ($::ALL))
if ($::NTP)
{
config_ntp();
}
@ -171,9 +172,19 @@ sub config_ssh {
if (@config_switches) {
#update switch status
my $csw = join(",",@config_switches);
$cmd = "chdef $csw status=ssh_configed ";
$cmd = "chdef $csw status=ssh_configured otherinterfaces=";
$rc= xCAT::Utils->runcmd($cmd, 0);
print "ssh configured for $csw\n";
if ($::ALL) {
$cmd = "updatenode $csw -P hardeths,enablesnmp,configinterface";
$rc= xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0) {
xCAT::MsgUtils->message("E","Failed to run updatenode, please check the switch");
}
$cmd = "chdef $csw status=configured";
$rc= xCAT::Utils->runcmd($cmd, 0);
print "switch: $csw configured\n";
}
}
}
@ -369,7 +380,7 @@ sub config_ntp {
if (@config_switches) {
#update switch status
my $csw = join(",",@config_switches);
$cmd = "chdef $csw status=ntp_configed";
$cmd = "chdef $csw status=ntp_configured";
$rc= xCAT::Utils->runcmd($cmd, 0);
}
@ -394,7 +405,7 @@ sub usage
configonie --switches switchnames --snmp
configonie --switches switchnames --ntp
To set ssh, install license(license file: /root/license.txt), config snmp and ntp:
To setup ssh passwordless, change ip to static, enable snmp configuration and configure basic interface :
configonie --switches switchnames --all
\n";
}