From d3a63ffbec643f7a2746dfe2db2313492ef163af Mon Sep 17 00:00:00 2001 From: cheliequan <liequanche@126.com> Date: 星期三, 31 五月 2023 09:57:21 +0800 Subject: [PATCH] 更新rancher部署代码 --- src/rancher/rancher.go | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/src/rancher/rancher.go b/src/rancher/rancher.go index 5bba2ba..80b2662 100644 --- a/src/rancher/rancher.go +++ b/src/rancher/rancher.go @@ -6,11 +6,24 @@ "basic.com/aps/aps_deploy.git/src/util" ) -type RancherConfig struct { + +type Node struct { + Roles []string `json:"roles"` + IP string `json:"ip"` + SSHUsername string `json:"sshUsername"` + SSHPassword string `json:"sshPassword"` + SSHPort int `json:"sshPort"` +} + + +type RancherClusterConfig struct { RancherURL string `json:"rancherURL"` BearerToken string `json:"bearerToken"` + ClusterName string `mapstructure:"ClusterName"` + Nodes []Node `mapstructure:"Nodes"` } + func isRancherInstalled(ip, username, password string, sshPort int) (bool, error) { // 妫�鏌ancher瀹瑰櫒鏄惁宸茶繍琛� checkRancherCommand := "sudo docker ps --format '{{.Image}}' | grep -q rancher/rancher:v2.5.17" -- Gitblit v1.8.0