]> git.proxmox.com Git - pve-cluster.git/commitdiff
pvecm join: also default to resolved IP with use_ssh param
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 29 Mar 2018 09:06:08 +0000 (11:06 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 3 Apr 2018 07:19:17 +0000 (09:19 +0200)
We already switched to this behaviour in pvecm create and pvecm join
(with API) but did not changed it for the case when a user requested
to use the old method to join with --use_ssh.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/PVE/CLI/pvecm.pm

index 7e165868ee1f07f694ec466969754a811f1b76a8..23a15a920ba3b8565049e5f760635a7708e34eef 100755 (executable)
@@ -107,6 +107,7 @@ __PACKAGE__->register_method ({
        my $nodename = PVE::INotify::nodename();
 
        my $host = $param->{hostname};
+       my $local_ip_address = remote_node_ip($nodename);
 
        PVE::Cluster::assert_joinable($param->{ring0_addr}, $param->{ring1_addr}, $param->{force});
 
@@ -150,7 +151,7 @@ __PACKAGE__->register_method ({
 
            push @$cmd, '--nodeid', $param->{nodeid} if $param->{nodeid};
            push @$cmd, '--votes', $param->{votes} if defined($param->{votes});
-           push @$cmd, '--ring0_addr', $param->{ring0_addr} if defined($param->{ring0_addr});
+           push @$cmd, '--ring0_addr', $param->{ring0_addr} // $local_ip_address;
            push @$cmd, '--ring1_addr', $param->{ring1_addr} if defined($param->{ring1_addr});
 
            if (system (@$cmd) != 0) {