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

56 lines
1.3 KiB
Go

package a_init
import (
"wdd.io/agent-go/a_agent"
"wdd.io/agent-go/a_executor"
"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()
refreshAgentInfoByStatusInfo(agentInfo, agentServerInfo)
BuildAgentOsOperator(agentInfo, agentServerInfo)
// install docker
agentOsOperator := a_executor.AgentOsOperatorCache
// boot up minio & rabbitmq
agentOsOperator.InstallDockerFromLocalExec(nil)
agentOsOperator.InstallDockerComposeFromLocalExec()
// build for socks server
}