Commit 9294514d authored by René Nussbaumer's avatar René Nussbaumer

Change bootstrap.SetupDaemonNode to use scp as we can assume SSH is setup

Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarManuel Franceschini <livewire@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent c30421e0
...@@ -512,26 +512,15 @@ def SetupNodeDaemon(cluster_name, node, ssh_key_check): ...@@ -512,26 +512,15 @@ def SetupNodeDaemon(cluster_name, node, ssh_key_check):
# and then connect with ssh to set password and start ganeti-noded # and then connect with ssh to set password and start ganeti-noded
# note that all the below variables are sanitized at this point, # note that all the below variables are sanitized at this point,
# either by being constants or by the checks above # either by being constants or by the checks above
# TODO: Could this command exceed a shell's maximum command length? sshrunner.CopyFileToNode(node, constants.NODED_CERT_FILE)
mycommand = ("umask 077 && " sshrunner.CopyFileToNode(node, constants.RAPI_CERT_FILE)
"cat > '%s' << '!EOF.' && \n" sshrunner.CopyFileToNode(node, constants.CONFD_HMAC_KEY)
"%s!EOF.\n" mycommand = ("%s start %s -b '%s'" % (constants.DAEMON_UTIL, constants.NODED,
"cat > '%s' << '!EOF.' && \n" bind_address))
"%s!EOF.\n"
"cat > '%s' << '!EOF.' && \n"
"%s!EOF.\n"
"chmod 0400 %s %s %s && "
"%s start %s -b '%s'" %
(constants.NODED_CERT_FILE, noded_cert,
constants.RAPI_CERT_FILE, rapi_cert,
constants.CONFD_HMAC_KEY, confd_hmac_key,
constants.NODED_CERT_FILE, constants.RAPI_CERT_FILE,
constants.CONFD_HMAC_KEY,
constants.DAEMON_UTIL, constants.NODED, bind_address))
result = sshrunner.Run(node, 'root', mycommand, batch=False, result = sshrunner.Run(node, 'root', mycommand, batch=False,
ask_key=ssh_key_check, ask_key=ssh_key_check,
use_cluster_key=False, use_cluster_key=True,
strict_host_check=ssh_key_check) strict_host_check=ssh_key_check)
if result.failed: if result.failed:
raise errors.OpExecError("Remote command on node %s, error: %s," raise errors.OpExecError("Remote command on node %s, error: %s,"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment