rancher / quickstart

382 stars 342 forks source link

Provider "rke" not available for installation #56

Closed sneakersgames closed 4 years ago

sneakersgames commented 4 years ago
Initializing provider plugins...
- Checking for available provider plugins...

Provider "rke" not available for installation.

A provider named "rke" could not be found in the Terraform Registry.

This may result from mistyping the provider name, or the given provider may
be a third-party provider that cannot be installed automatically.

In the latter case, the plugin must be installed manually by locating and
downloading a suitable distribution package and placing the plugin's executable
file in the following directory:
    terraform.d/plugins/darwin_amd64

Terraform detects necessary plugins by inspecting the configuration and state.
To view the provider versions requested by each module, run
"terraform providers".

Error: no provider exists with the given name

Provider installed on both ~/ terraform.d/plugins/darwin_amd64 and ~/ terraform.d/plugins/darwin_amd64, named both terraform-provider-rke and terraform-provider-rke_v0.14.1

image

srirajan commented 4 years ago

Got a similar error.

$ terraform12 init Initializing modules...

Initializing the backend...

Initializing provider plugins...

Provider "rke" not available for installation.

A provider named "rke" could not be found in the Terraform Registry.

This may result from mistyping the provider name, or the given provider may be a third-party provider that cannot be installed automatically.

In the latter case, the plugin must be installed manually by locating and downloading a suitable distribution package and placing the plugin's executable file in the following directory: terraform.d/plugins/darwin_amd64

Terraform detects necessary plugins by inspecting the configuration and state. To view the provider versions requested by each module, run "terraform providers".

Error: no provider exists with the given name

$ ls ~/.terraform.d/plugins/ darwin_amd64 terraform-provider-rke

$ ls ~/.terraform.d/plugins/darwin_amd64/ terraform-provider-rke

[Edit] Tried copying the plugin to the folder's .terraform directory, but still the same issue.

$ ls .terraform/plugins/darwin_amd64/ terraform-provider-aws_v2.53.0_x4 terraform-provider-kubernetes_v1.10.0_x4 terraform-provider-rancher2_v1.7.2_x4 terraform-provider-helm_v1.0.0_x4 terraform-provider-local_v1.4.0_x4 terraform-provider-rke

ghost commented 4 years ago

Provider "rke" not available for installation.

Please refer the terraform official documentation and try to use the "rancher2" as a provider I wish that will resolve your issue. https://www.terraform.io/docs/providers/rancher2/index.html

I have reviewed the terraform documentation link on the rke provider repository where the provider documentation link is broken, seems like reference is bit outdated. https://github.com/rancher/terraform-provider-rke https://www.terraform.io/docs/providers/rke/index.html

srirajan commented 4 years ago

Thanks for the response. Rancher2 is already included in the providers and I am using the example described here https://github.com/rancher/quickstart/blob/master/rancher-common/provider.tf

However, after experimenting a bit, if I remove the RKE provider in the above template, it works

nikkelma commented 4 years ago

Hey all, this is a result of the RKE provider still being a community plugin and not able to be installed through terraform init. A requirement in the README gives a link to the installation process for the RKE provider. As soon as the RKE provider is an official plugin, the provider will be updated to allow terraform init to install all plugins.

ajithgudem commented 4 years ago

Will the "Terraform Provider for RKE" actively maintained to be compatible with current and future rke releases. I ask because I did not see this listed as on the official list of terraform providers on https://www.terraform.io/docs/providers/ but found an obsolete link on https://github.com/rancher/terraform-provider-rke#using-the-provider pointing to https://www.terraform.io/docs/providers/rke/index.html

shpwrck commented 4 years ago

The rke provider is currently in the process of making it's way into https://www.terraform.io/docs/providers/, and will be maintained.

nikkelma commented 4 years ago

@sneakersgames I apologize for misunderstanding your original question - the issue according to your screenshot is that terraform expects platform-specific plugins to be installed under <OS>_<arch>. In the case of your screenshot, the expected folder name is darwin_amd64 but it appears your folder is named darwin-amd64 (notice the dash instead of an underscore).

AlphaWong commented 4 years ago

same issue. After I copy it.

/Users/Alpha/.terraform.d/plugins/darwin_amd64
total 127072
-rwxr-xr-x@ 1 Alpha  staff    62M Apr  7 16:04 terraform-provider-rke
srirajan commented 4 years ago

For me, doing the following helped. In rancher-common/provider.tf, comment the rke provider

# RKE provider - community plugin as of 2020-02-02
#provider "rke" {
#  version = "0.14.1"
#}
AlphaWong commented 4 years ago

For me, doing the following helped. In rancher-common/provider.tf, comment the rke provider

# RKE provider - community plugin as of 2020-02-02
#provider "rke" {
#  version = "0.14.1"
#}

true. but I do not know it will break something or not.

AlphaWong commented 4 years ago

I find out the reason. The current document is outdated.

  1. rename it to terraform-provider-rke_v0.14.1
  2. put it to ~/.terraform.d/plugins
  3. remove the .terraform in ur project_directory
  4. run terraform init
nikkelma commented 4 years ago

89 has been merged, are these documentation changes enough to close this issue?

haimari commented 4 years ago

I find out the reason. The current document is outdated.

  1. rename it to terraform-provider-rke_v0.14.1
  2. put it to ~/.terraform.d/plugins
  3. remove the .terraform in ur project_directory
  4. run terraform init

Getting this error:

[aws] terraform init                                                                                                                                                                                     master  ✗
Initializing modules...
- rancher_common in ../rancher-common

Initializing the backend...

Initializing provider plugins...
- Checking for available provider plugins...
- Downloading plugin for provider "helm" (hashicorp/helm) 1.0.0...
- Downloading plugin for provider "rancher2" (terraform-providers/rancher2) 1.8.3...

Provider "rke" not available for installation.

A provider named "rke" could not be found in the Terraform Registry.

This may result from mistyping the provider name, or the given provider may
be a third-party provider that cannot be installed automatically.

In the latter case, the plugin must be installed manually by locating and
downloading a suitable distribution package and placing the plugin's executable
file in the following directory:
    terraform.d/plugins/darwin_amd64

Terraform detects necessary plugins by inspecting the configuration and state.
To view the provider versions requested by each module, run
"terraform providers".

- Downloading plugin for provider "aws" (hashicorp/aws) 2.41.0...
- Downloading plugin for provider "tls" (hashicorp/tls) 2.1.1...
- Downloading plugin for provider "local" (hashicorp/local) 1.4.0...
- Downloading plugin for provider "kubernetes" (hashicorp/kubernetes) 1.10.0...

Error: no provider exists with the given name

This worked for me:

mv  ~/.terraform.d/plugins/darwin_amd64/terraform-provider-rke_v0.14.1 ~/.terraform.d/plugins/darwin_amd64/terraform-provider-rke_v1.0.0
[aws] terraform init                                                                                                                                                                                     master  ✗
Initializing modules...
- rancher_common in ../rancher-common

Initializing the backend...

Initializing provider plugins...
- Checking for available provider plugins...
- Downloading plugin for provider "tls" (hashicorp/tls) 2.1.1...
- Downloading plugin for provider "local" (hashicorp/local) 1.4.0...
- Downloading plugin for provider "rancher2" (terraform-providers/rancher2) 1.8.3...
- Downloading plugin for provider "kubernetes" (hashicorp/kubernetes) 1.10.0...
- Downloading plugin for provider "helm" (hashicorp/helm) 1.0.0...
- Downloading plugin for provider "aws" (hashicorp/aws) 2.41.0...

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
nikkelma commented 4 years ago

@haimari Yes, this issue was created when the required version of the RKE provider was 0.14.1 - my comment above you references a merged PR that added installation instructions for terraform-provder-rke in the README.

matinats commented 3 years ago

I was able to solve that issue by manually downloading the rke v1.1.5 as defined here: https://github.com/rancher/terraform-provider-rke and then creating a directory path ~/.terraform.d/plugins/registry.terraform.io/hashicorp/rke/1.1.5/linux_amd64/ and copying the unzipped file here as terraform-provider-rke.