I'm new to Terraform and I'd like to try it out by setting up my new lab. The lab hosted on remote proxmox hypervisor, and my terraform is running on docker container. I downloaded the proxmox provider from github (https://github.com/andrexus/terraform-provider-proxmox).
If got it right, I need to write a terraform config file that specifies the provider location inside container ($HOME/.terraformrc) with the following instruction:
providers {
proxmox = "/path/to/provider/directory"
}
and then I wrote a main.tf in order to validate the terraform provider:
provider "proxmox" {
host = "https://myproxmux:port"
I tried to to set up the provider path with url and local path. I also tried to specify the path in terraform init command with --plugin-dir=path/to/dir
but I get the following error:
2020/12/02 19:53:00 [INFO] Terraform version: 0.13.5
2020/12/02 19:53:00 [INFO] Go runtime version: go1.14.7
2020/12/02 19:53:00 [INFO] CLI args: []string{"/usr/local/bin/terraform", "init"}
2020/12/02 19:53:00 [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2020/12/02 19:53:00 Loading CLI configuration from /root/.terraformrc
2020/12/02 19:53:00 [DEBUG] checking for credentials in "/root/.terraform.d/plugins"
2020/12/02 19:53:00 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2020/12/02 19:53:00 [DEBUG] will search for provider plugins in /root/.terraform.d/plugins
2020/12/02 19:53:00 [TRACE] getproviders.SearchLocalDirectory: /root/.terraform.d/plugins is a symlink to /root/.terraform.d/plugins
2020/12/02 19:53:00 [WARN] local provider path "/root/.terraform.d/plugins/proxomx/proxmox/config.go" contains invalid type "config.go"; ignoring
2020/12/02 19:53:00 [WARN] local provider path "/root/.terraform.d/plugins/proxomx/proxmox/resource_storage.go" contains invalid type "resource_storage.go"; ignoring
2020/12/02 19:53:00 [WARN] local provider path "/root/.terraform.d/plugins/proxomx/proxmox/resource_vm.go" contains invalid type "resource_vm.go"; ignoring
2020/12/02 19:53:00 [DEBUG] ignoring non-existing provider search directory /root/.local/share/terraform/plugins
2020/12/02 19:53:00 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2020/12/02 19:53:00 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2020/12/02 19:53:00 [INFO] CLI command args: []string{"init"}Initializing the backend...
Initializing provider plugins... Finding latest version of hashicorp/proxmox...
2020/12/02 19:53:00 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2020/12/02 19:53:00 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2020/12/02 19:53:00 [DEBUG] New state was assigned lineage "bbde6bfd-55be-d7fa-f473-6aa043f492ca"
2020/12/02 19:53:00 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
2020/12/02 19:53:00 [TRACE] Meta.Backend: instantiated backend of type
2020/12/02 19:53:00 [DEBUG] checking for provisioner in "."
2020/12/02 19:53:00 [DEBUG] checking for provisioner in "/usr/local/bin"
2020/12/02 19:53:00 [DEBUG] checking for provisioner in "/root/.terraform.d/plugins"
2020/12/02 19:53:00 [INFO] Failed to read plugin lock file .terraform/plugins/linux_amd64/lock.json: open .terraform/plugins/linux_amd64/lock.json: no such file or directory
2020/12/02 19:53:00 [TRACE] Meta.Backend: backend does not support operations, so wrapping it in a local backend
2020/12/02 19:53:00 [TRACE] backend/local: state manager for workspace "default" will:
- read initial snapshot from terraform.tfstate
- write new snapshots to terraform.tfstate
- create any backup at terraform.tfstate.backup
2020/12/02 19:53:00 [TRACE] statemgr.Filesystem: reading initial snapshot from terraform.tfstate
2020/12/02 19:53:00 [TRACE] statemgr.Filesystem: snapshot file has nil snapshot, but that's okay
2020/12/02 19:53:00 [TRACE] statemgr.Filesystem: read nil snapshot
2020/12/02 19:53:00 [TRACE] providercache.fillMetaCache: scanning directory .terraform/plugins
2020/12/02 19:53:00 [TRACE] getproviders.SearchLocalDirectory: failed to resolve symlinks for .terraform/plugins: lstat .terraform: no such file or directory
2020/12/02 19:53:00 [TRACE] providercache.fillMetaCache: error while scanning directory .terraform/plugins: cannot search .terraform/plugins: lstat .terraform/plugins: no such file or directory
2020/12/02 19:53:00 [WARN] Failed to scan provider cache directory .terraform/plugins: cannot search .terraform/plugins: lstat .terraform/plugins: no such file or directory
2020/12/02 19:53:00 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
2020/12/02 19:53:00 [TRACE] HTTP client GET request to https://registry.terraform.io/.well-known/terraform.json
2020/12/02 19:53:00 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/proxmox/versions
2020/12/02 19:53:00 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/hashicorp/proxmox/versions
2020/12/02 19:53:00 [DEBUG] GET https://registry.terraform.io/v1/providers/-/proxmox/versions
2020/12/02 19:53:00 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/-/proxmox/versionsError: Failed to install provider
Error while installing hashicorp/proxmox: provider registry registry.terraform.io does not have a provider named registry.terraform.io/hashicorp/proxmox
So, I can see that my terraformrc file is red but I don't understand why my provider is not used and what I do wrong...
Any ideas ? :) Thanks in advance for your replies!