Files
ProjectOctopus/agent-go/BastionInitializaion.go
2024-03-29 11:39:14 +08:00

57 lines
1.3 KiB
Go

package main
import (
"wdd.io/agent-go/a_agent"
"wdd.io/agent-go/a_executor"
"wdd.io/agent-go/a_init"
"wdd.io/agent-go/a_status"
)
func BastionModeInit() {
// Build For Operator
agentServerInfo := &a_agent.AgentServerInfo{
ServerName: "BastionSingle",
ServerIPPbV4: "127.0.0.1",
ServerIPInV4: "127.0.0.1",
ServerIPPbV6: "",
ServerIPInV6: "",
Location: "Bastion",
Provider: "Bastion",
ManagePort: "22",
CPUCore: "",
CPUBrand: "",
OSInfo: "",
OSKernelInfo: "",
TCPControl: "",
Virtualization: "",
Platform: "",
PlatformFamily: "",
PlatformVersion: "",
KernelVersion: "",
KernelArch: "",
IoSpeed: "",
MemoryTotal: "",
DiskTotal: "",
DiskUsage: "",
Comment: "",
MachineID: "",
AgentVersion: "",
TopicName: "BastionNode",
}
// re-get agentInfo from status module
agentInfo := a_status.ReportAgentInfo()
a_init.refreshAgentInfoByStatusInfo(agentInfo, agentServerInfo)
a_init.BuildAgentOsOperator(agentInfo, agentServerInfo)
// install docker
agentOsOperator := a_executor.AgentOsOperatorCache
// boot up minio & rabbitmq
agentOsOperator.InstallDockerFromLocalExec(nil)
agentOsOperator.InstallDockerComposeFromLocalExec()
// build for socks server
}