Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Can't pass openstack provider from root #1

Closed
gavvvr opened this issue Feb 4, 2018 · 2 comments
Closed

Can't pass openstack provider from root #1

gavvvr opened this issue Feb 4, 2018 · 2 comments

Comments

@gavvvr
Copy link

gavvvr commented Feb 4, 2018

Hi. I try to use this project as terraform module. I declare a it like this:

module "network" {
  source = "ovh/publiccloud-network/ovh"

  providers = {
    ovh = "ovh.ovh"
    openstack = "openstack.ovh"
  }
...
}

And it gets downloaded with terraform init. As you can see I try to explicitly pass provider which I declared in my root module:

provider "openstack" {
  auth_url = "https://auth.cloud.ovh.net/v3" # Authentication URL
  domain_name = "default" # Domain Name - Always "default" for OVH
  alias = "ovh"
  region = "${var.region}"
  user_name   = "${var.user_name}"
  password    = "${var.password}"
}

The problem is that terraform plan gives me:

Error: Error running plan: 1 error(s) occurred:

  • module.network.provider.openstack: One of 'auth_url' or 'cloud' must be specified

I think it happens because of provider "openstack" is already defined here in main.tf.
If I comment it, the provider from my root is successfully used.

I also noticed that terraform tries to apply everything from examples directory of this module which is not my goal.

So, what is the correct use of this module? I would like to pass my own provider and do not get examples applied from here.

Looks like the most suitable options to use this module is to copy main.tf from here to my repo. But Terraform registry and documentation tells me that I just should declare it with source = "ovh/publiccloud-network/ovh"

Thanks

@yanndegat
Copy link
Collaborator

hi @gavvvr

you're perfectly right on the "provider" issue.
i've already fixed this on other modules. even thought i fixed this one a long ago.
i'll fix this right away.

on the "examples" issue though, i've never noticed such behavior.
we should dig this a little bit further.

could you provide more info on the versions of terraform you're using for a start?

thanks a lot

@CoericK
Copy link

CoericK commented Dec 8, 2018

For me it was working fine but now im getting the error * provider.openstack: One of 'auth_url' or 'cloud' must be specified what should I do to fix this? I didnt add any other provider

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants