[REV] add compute node uid to init script

This commit is contained in:
bay1ts 2017-11-27 17:42:10 +08:00
parent 992dea9342
commit 71dee0d194
2 changed files with 3 additions and 2 deletions

View File

@ -203,7 +203,7 @@ func NewCmdNode() cli.Command {
Usage: "RootPass",
},
cli.StringSliceFlag{
Name: "Role,r",
Name: "Role,ro",
Usage: "Role|required",
},
},

View File

@ -299,8 +299,9 @@ func (n *NodeCluster) checkNodeInstall(node *model.HostNode) {
var stdout bytes.Buffer
var stderr bytes.Buffer
role:=node.Role[0]
etcd:=n.currentNode.InternalIP
cmd:="bash -c \"set "+etcd+" "+role+";$(curl -s repo.goodrain.com/gaops/jobs/install/prepare/init.sh)\""
cmd:="bash -c \"set "+node.ID+" "+etcd+" "+role+";$(curl -s repo.goodrain.com/gaops/jobs/install/prepare/init.sh)\""
logrus.Infof("init endpoint node cmd is %s",cmd)
client := util.NewSSHClient(node.InternalIP, "root", node.RootPass, cmd, 22, &stdout, &stderr)
if err := client.Connection(); err != nil {