terraform-equinix-metal-anthos-on-vsphere icon indicating copy to clipboard operation
terraform-equinix-metal-anthos-on-vsphere copied to clipboard

update vsphere module to v3.0.0

Open displague opened this issue 3 years ago • 4 comments

Signed-off-by: Marques Johansson [email protected]

displague avatar May 05 '21 00:05 displague

A few CI failures here related to VLAN attachment:

Error: POST https://api.equinix.com/metal/v1/ports/b6ade5c2-966a-4707-98b0-e4fea402ffd9/assign: 422 Can't assign vlan, the port is configured for Layer 3 

  on .terraform/modules/vsphere/main.tf line 98, in resource "metal_port_vlan_attachment" "router_priv_vlan_attach":
  98: resource "metal_port_vlan_attachment" "router_priv_vlan_attach" ***



Error: POST https://api.equinix.com/metal/v1/ports/b6ade5c2-966a-4707-98b0-e4fea402ffd9/assign: 422 Can't assign vlan, the port is configured for Layer 3 

  on .terraform/modules/vsphere/main.tf line 105, in resource "metal_port_vlan_attachment" "router_pub_vlan_attach":
 105: resource "metal_port_vlan_attachment" "router_pub_vlan_attach" ***

displague avatar May 18 '21 17:05 displague

rerunning test after failure due to no c3.smalls in sv15

displague avatar May 20 '21 15:05 displague

It appears that reserved_ip_count is present in the subnet dictionary, when it previously was not: https://github.com/equinix/terraform-metal-anthos-on-vsphere/pull/127/checks#step:14:1260

I'm thinking that the typed variable changes here are leading to {"reserved_ip_count": null} in the json. https://github.com/equinix/terraform-metal-anthos-on-vsphere/blob/vsphere-module-3.0.0/variables.tf#L49

I'll update the PR to check for if subnet.get("reserved_ip_count") is not None: at https://github.com/equinix/terraform-metal-vsphere/blob/v3.0.0/templates/pre_reqs.py#L117

displague avatar May 20 '21 20:05 displague

We'll need to use https://registry.terraform.io/providers/hashicorp/local/latest/docs/data-sources/file rather that file(some_user_variable).

╷
│ Error: Invalid function argument
│ 
│   on 32-anthos-pre-reqs.tf line 16, in resource "null_resource" "anthos_pre_reqs":
│   16:     private_key = file(module.vsphere.ssh_key_path)
│     ├────────────────
│     │ module.vsphere.ssh_key_path is "$HOME/.ssh/marques-anthos-project-9wtgd-key"
│ 
│ Invalid value for "path" parameter: no file exists at $HOME/.ssh/marques-anthos-project-9wtgd-key; this function works only with files that are distributed as part of the
│ configuration source code, so if this file will be created by a resource in this configuration you must instead obtain this result from an attribute of that resource.
╵
╷
│ Error: Invalid function argument
│ 
│   on 33-anthos-deploy-admin-workstation.tf line 67, in resource "null_resource" "anthos_deploy_workstation":
│   67:     private_key = file(module.vsphere.ssh_key_path)
│     ├────────────────
│     │ module.vsphere.ssh_key_path is "$HOME/.ssh/marques-anthos-project-9wtgd-key"
│ 
│ Invalid value for "path" parameter: no file exists at $HOME/.ssh/marques-anthos-project-9wtgd-key; this function works only with files that are distributed as part of the
│ configuration source code, so if this file will be created by a resource in this configuration you must instead obtain this result from an attribute of that resource.
╵

displague avatar Jul 28 '21 20:07 displague