This commit is contained in:
yanbang
2026-02-06 13:44:35 +08:00
parent 2df48fe2eb
commit 078be77e0f
5 changed files with 269 additions and 0 deletions

34
variables.tf Normal file
View File

@@ -0,0 +1,34 @@
#通过流水线创建的虚拟机都需要通过这份文件进行密钥管理
variable "ssh_key" {
description = "虚拟机SSH登录公钥"
type = string
default = "xxx" // 占位符,真实值从建木密钥获取
}
variable "vsphere_user" {
description = "vSphere/VCenter管理员登录用户名"
type = string
default = "xxx" // vcenter用户名
sensitive = true // 标记为敏感信息Terraform日志隐藏输出
}
variable "vsphere_password" {
description = "vSphere/VCenter管理员登录密码"
type = string
default = "xxx" // vcenter密码
sensitive = true // 标记为敏感信息Terraform日志隐藏输出
}
variable "vsphere_server" {
description = "vSphere地址"
type = string
default = "xxx" // 服务器地址
}
variable "ssh_private_key_content" {
description = "SH私钥内容用于Terraform远程连接虚拟机)"
type = string
default = "xxx" # 占位符,真实值从建木获取
sensitive = true # 标记为敏感Terraform 日志会隐藏,防止泄露
}