hostrsapubkey => {
description => "Public SSH RSA key for the host.",
type => 'string',
+ pattern => '^[A-Za-z0-9\.\/\+]{200,}$',
},
rootrsapubkey => {
description => "Public SSH RSA key for the root user.",
type => 'string',
+ pattern => '^[A-Za-z0-9\.\/\+]{200,}$',
+ },
+ fingerprint => {
+ description => "SSL certificate fingerprint.",
+ type => 'string',
+ pattern => '^(:?[A-Z0-9][A-Z0-9]:){31}[A-Z0-9][A-Z0-9]$',
},
};
}
name => { fixed => 1 },
hostrsapubkey => {},
rootrsapubkey => {},
+ fingerprint => {},
};
}
name => { fixed => 1 },
hostrsapubkey => {},
rootrsapubkey => {},
+ fingerprint => {},
};
}
sub lock_config {
my ($code, $errmsg) = @_;
- my $p = PVE::Tools::lock_file($lockfile, undef, $code);
+ my $res = PVE::Tools::lock_file($lockfile, undef, $code);
if (my $err = $@) {
$errmsg ? die "$errmsg: $err" : die $err;
}
+ return $res;
}
sub read_cluster_conf {
my $localip = PMG::Utils::lookup_node_ip($localname);
$cinfo->{remnodes} = [];
- $cinfo->{configport}->{0} = 83;
- $cinfo->{dbport}->{0} = 5432;
$cinfo->{local} = {
cid => 0,
$cinfo->{master}->{maxcid} = $maxcid;
}
- my $ind = 0;
+ my $local_cid = $cinfo->{local}->{cid};
foreach my $cid (sort keys %{$cinfo->{ids}}) {
- if ($cinfo->{'local'}->{cid} == $cid) { # local CID
- $cinfo->{configport}->{$cid} = 83;
- $cinfo->{dbport}->{$cid} = 5432;
- } else {
- my $portid = $ind++;
- $cinfo->{configport}->{$cid} = 50000 + $portid;
- $cinfo->{dbport}->{$cid} = 50100 + $portid;
+ if ($local_cid != $cid) {
push @{$cinfo->{remnodes}}, $cid;
}
}