新增cursor的配置
This commit is contained in:
@@ -4,7 +4,9 @@ import (
|
||||
"agent-wdd/config"
|
||||
"agent-wdd/log"
|
||||
"agent-wdd/op"
|
||||
"agent-wdd/utils"
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -15,6 +17,8 @@ var (
|
||||
centosCommonTools = []string{
|
||||
"deltarpm", "net-tools", "iputils", "bind-utils", "lsof", "curl", "wget", "vim", "mtr", "htop",
|
||||
}
|
||||
|
||||
dockerLocalInstallPath = "/root/wdd/docker-20.10.15.tgz" // 本地安装docker的文件路径
|
||||
)
|
||||
|
||||
// 添加base子命令
|
||||
@@ -77,7 +81,22 @@ func addDockerSubcommands(cmd *cobra.Command) {
|
||||
Short: "网络安装Docker",
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Printf("Installing Docker version: %s\n", args[0])
|
||||
|
||||
// 检查参数
|
||||
if len(args) > 0 {
|
||||
fmt.Printf("Installing Docker version: %s\n", args[0])
|
||||
}
|
||||
|
||||
// 没有传递参数,使用默认参数
|
||||
version := "26.0.7"
|
||||
log.Info("Installing Docker version: %s", version)
|
||||
|
||||
// 安装docker
|
||||
packOperator := op.AgentPackOperator
|
||||
packOperator.PackageInit()
|
||||
// ubuntu 和 centos的安装命令是不是一样的
|
||||
packOperator.Install([]string{"docker-ce", "docker-ce-cli", "containerd.io", "docker-buildx-plugin", "docker-compose-plugin"})
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
@@ -94,7 +113,14 @@ func addDockerSubcommands(cmd *cobra.Command) {
|
||||
Short: "本地安装Docker",
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Printf("Installing Docker from: %s\n", args[0])
|
||||
exist := utils.FileExistAndNotNull(dockerLocalInstallPath)
|
||||
if !exist {
|
||||
log.Error("Docker local install file not found: %s", dockerLocalInstallPath)
|
||||
return
|
||||
}
|
||||
|
||||
// 解压文件
|
||||
utils.Unzip(dockerLocalInstallPath, "/root/wdd")
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ try {
|
||||
Write-Host "4. Exec the command ..." -ForegroundColor Blue
|
||||
Write-Host ""
|
||||
Write-Host ""
|
||||
ssh root@192.168.35.71 "chmod +x agent-wdd_linux_amd64 && ./agent-wdd_linux_amd64 base tools"
|
||||
ssh root@192.168.35.71 "chmod +x agent-wdd_linux_amd64 && ./agent-wdd_linux_amd64 info disk"
|
||||
Write-Host ""
|
||||
Write-Host ""
|
||||
Write-Host "5. Cheak Info Result ..." -ForegroundColor Blue
|
||||
|
||||
@@ -53,6 +53,7 @@ func (op *PackageOperator) Install(tools []string) {
|
||||
}
|
||||
}
|
||||
|
||||
// PackageInit 初始化包管理器, 如果本机是ubuntu或者debian, 则使用apt, 否则使用yum
|
||||
func (op *PackageOperator) PackageInit() {
|
||||
log.Info("PackageInit !")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user