add a new flag -t to makeconservercf to specify additional trusted hosts with conserver
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14555 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -10,6 +10,8 @@ B<makeconservercf> [B<-V|--verbose>] [B<-l|--local>] | ||||
|  | ||||
| B<makeconservercf> [B<-V|--verbose>] [B<-c|--conserver>] I<noderange> | ||||
|  | ||||
| B<makeconservercf> [B<-V|--verbose>] I<noderange> [B<-t|--trust>] I<hosts> | ||||
|  | ||||
| B<makeconservercf> [B<-h|--help|-v|--version>] | ||||
|  | ||||
|  | ||||
| @@ -44,6 +46,11 @@ is set for nodes, the conserver gets set up only on the management node. | ||||
| Only run B<makeconservercf> locally and create the local /etc/conserver.cf.  The default is to also | ||||
| run it on all service nodes, if there are any. | ||||
|  | ||||
| =item B<-t|--trust> I<hosts> | ||||
|  | ||||
| Add additional trusted hosts into /etc/conserver.cf. The I<hosts> are comma separated list of | ||||
| ip addresses or host names.  | ||||
|  | ||||
| =item B<-v|--version> | ||||
|  | ||||
| Display version. | ||||
|   | ||||
| @@ -241,6 +241,16 @@ sub docfheaders { | ||||
|           push @ips,$ip; | ||||
|       } | ||||
|   } | ||||
|   if ($::TRUSTED_HOST) | ||||
|   { | ||||
|       my @trusted_host = (split /,/, $::TRUSTED_HOST); | ||||
|       foreach my $tip (@trusted_host) | ||||
|       { | ||||
|           if(!grep(/^$tip$/, @ips)) { | ||||
|               push @ips,$tip; | ||||
|           } | ||||
|       } | ||||
|   } | ||||
|   if(scalar(@ips) > 0) { | ||||
|       my $ipstr = join(',', @ips); | ||||
|       push @newheaders, "  trusted $ipstr;\n"; | ||||
| @@ -285,7 +295,9 @@ sub makeconservercf { | ||||
|   $Getopt::Long::ignorecase=0; | ||||
|   #$Getopt::Long::pass_through=1; | ||||
|   my $delmode; | ||||
|   GetOptions('d|delete'  => \$delmode); | ||||
|   GetOptions('d|delete'  => \$delmode, | ||||
|              't|trust=s' => \$::TRUSTED_HOST | ||||
|             ); | ||||
|   my $nodes = $req->{node}; | ||||
|   my $svboot=0; | ||||
|   if (exists($req->{svboot})) { $svboot=1;} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user