Терраформ 1.0.1, есть такой вот рабочий код(проверял в 0.14.9):
*
provider.tf*
provider "vsphere" {
alias = "dc1"
user = "user"
password = "password"
vsphere_server = "
1.1.1.1"
allow_unverified_ssl = true
}
provider "vsphere" {
alias = "dc2"
user = "user"
password = "password"
vsphere_server = "
2.2.2.2"
allow_unverified_ssl = true
}
Вот сам код
main.tf:
module "cribl-worker-dc1-linuxvm" {
providers = {
vsphere = vsphere.dc1
}
source = "Terraform-VMWare-Modules/vm/vsphere"
version = "3.1.0"
dc = "DC1"
vmrp = "/DC1/host/vSAN Cluster/Resources"
...
...
}
module "cribl-worker-dc2-linuxvm" {
providers = {
vsphere = vsphere.dc2
}
source = "Terraform-VMWare-Modules/vm/vsphere"
version = "3.1.0"
dc = "DC2"
vmrp = "/DC2/host/vSAN Cluster/Resources"
...
...
}
Пробую сделать план:
Warning: Provider vsphere is undefined
│
│ on
main.tf line 7, in module "cribl-master-dc1-linuxvm":
│ 7: vsphere = vsphere.dc1
│
│ Module module.cribl-master-dc1-linuxvm does not declare a provider named vsphere.
│ If you wish to specify a provider configuration for the module, add an entry for vsphere in
│ the required_providers block within the module.
│
│ (and 2 more similar warnings elsewhere)
╵
╷
│ Error: Missing required argument
│
│ The argument "user" is required, but was not set.
╵
╷
│ Error: Missing required argument
│
│ The argument "password" is required, but was not set.