hashicorp / terraform-provider-ignition

Terraform Ignition provider
https://www.terraform.io/docs/providers/ignition/
Mozilla Public License 2.0
38 stars 64 forks source link

Ignition provider doesn't work with terraform-0.13 #70

Closed sdlarsen closed 4 years ago

sdlarsen commented 4 years ago

This it the setup

Terraform Version

                                                                          1 ↵

Terraform v0.13.0

Affected Resource(s)

Any ignition (or, anything really, as terraform errors out before doing any work)

Terraform Configuration Files

One of a bunch of version.tf files:

terraform {
  required_version = ">= 0.13"
  required_providers {
    ignition = {
      source = "terraform-providers/ignition"
    }
    template = {
      source = "hashicorp/template"
    }
  }
}

My provider.tf is untouched from 0.12:

provider "archive" {
  version = "~> 1.2.2"
  alias   = "default"
}

provider "ignition" {
  version = "~> 1.2.1"
  alias   = "default"
}

provider "template" {
  version = "~> 2.1.2"
  alias   = "default"
}

provider "aws" {
  version = "~> 3.2.0"
  alias   = "default"
  region  = var.region
  profile = "k8s"
}

provider "local" {
  version = "~> 1.3.0"
  alias   = "default"
}

provider "null" {
  version = "~> 2.1.2"
  alias   = "default"
}

provider "tls" {
  version = "~> 2.1.0"
  alias   = "default"
}

Debug Output

terraform plan output:

Error: missing provider provider["registry.terraform.io/hashicorp/ignition"].default

Expected Behavior

I would have expected it to actuallu use the already downloaded ignition provider. The output of terraform init:

Initializing modules...

Initializing the backend...

Initializing provider plugins...
- Using previously-installed hashicorp/archive v1.2.2
- Using previously-installed hashicorp/tls v2.1.1
- Using previously-installed hashicorp/aws v3.2.0
- Using previously-installed terraform-providers/ignition v1.2.1
- Using previously-installed terraform-providers/gitlab v2.11.0
- Using previously-installed terraform-providers/datadog v2.12.1
- Using previously-installed hashicorp/local v1.3.0
- Using previously-installed hashicorp/null v2.1.2
- Using previously-installed hashicorp/template v2.1.2

The following providers do not have any version constraints in configuration,
so the latest version was installed.

To prevent automatic upgrades to new major versions that may contain breaking
changes, we recommend adding version constraints in a required_providers block
in your configuration, with the constraint strings suggested below.

* terraform-providers/gitlab: version = "~> 2.11.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.

Actual Behavior

Errors out with the missing provider:

Error: missing provider provider["registry.terraform.io/hashicorp/ignition"].default

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan
sdlarsen commented 4 years ago

I had one versions.tf file in a directory that only references other modules (hence no providers listed). Output from the ignition module is used here though.

terraform {
  required_version = ">=0.12"
}

Turning that into the following makes it work:

terraform {
  required_version = ">= 0.13"
  required_providers {
    ignition = {
      source = "terraform-providers/ignition"
    }
  }
}

Only changing the version requirement to be >= 0.13 made no difference, and an empty required providers block did neither. Why all other providers aren't needed I don't know.

sdlarsen commented 4 years ago

Seem to work, although I can't explain the need for that particular provider.