Terraform - VSphere auto provisioning - No IP

What is the best way to provision a Ubuntu 22.04.3 VM into Vsphere? Tried a few ways but always ending up with no IP. Should I use an OVA template or should I make a template in VSphere from an ISO then deploy that? I want to configure the IP range for the VM’s based on a count and set the user credentials so I can run a script on the VMs. Is there anything I need to follow to prep the image for VSphere if I use ISO and template?

Thanks

Switched back to template and trying to do customisation block but doesn’t seem to be working anyone done this bit before?

    template_uuid = var.template_uuid

    customize {
      linux_options {
        host_name = "${var.type}${var.role}${count.index + 1}"
        domain    = "lcserver.co.uk"  
      }

      network_interface {}

      ipv4_gateway    = "10.0.0.1"
      dns_server_list = ["10.0.0.1", "1.1.1.1"]
    }
  }```