Terraform: git clone over SSH fails for modules hosted in Azure Repos

Created on 15 Sep 2018  ·  8Comments  ·  Source: hashicorp/terraform

Terraform Version

Terraform v0.11.8

Terraform Configuration Files

module "sql_server" {
  source = "git::ssh://[email protected]:v3/rlacher/Test/Test"
}

Debug Output


Gist

Crash Output

Expected Behavior


Clone remote Azure Repos repository.

Actual Behavior


Clone failed.

Steps to Reproduce

  • terraform init
  • Additional Context


    Terraform is running in the Azure Cloud Shell in this example. Also tested with local Ubuntu 16.04 installation on the same Terraform version.

    I'm able to successfully clone the repo using the same URL with git clone on both systems.

    References

    • #18566
    • #18541
    bug

    Most helpful comment

    I was able to get this to work with a URL format like: git::ssh://[email protected]/v3/paul0787/terraform-null-test/terraform-null-test, so in your case I think that would look like:

    module "sql_server" {
      source = "git::ssh://[email protected]/v3/rlacher/Test/Test"
    }
    

    (note the /v3 instead of :v3)

    Let me know if that works for you @tbondal @rlacherksu

    All 8 comments

    Any idea when this will be addressed? We’d like to use Azure Devops with Terraform but this has been a major blocker.

    Would be open to any known workarounds as well if there are any. Our organization is heavy into Azure.

    We are also struggling with this
    Tested with Terraform v0.11.10 on both windows 10 and MacOS 10.14

    I believe this code just wraps go-getter which is just executing git behind the scenes. Going to try to simulate this myself and see where the problem is (url format, go-getter, Terraform, etc.).

    I was able to get this to work with a URL format like: git::ssh://[email protected]/v3/paul0787/terraform-null-test/terraform-null-test, so in your case I think that would look like:

    module "sql_server" {
      source = "git::ssh://[email protected]/v3/rlacher/Test/Test"
    }
    

    (note the /v3 instead of :v3)

    Let me know if that works for you @tbondal @rlacherksu

    I just tested and it works for me as well- unfortunately I did not think about trying this... (changing : to /)

    Thanks!

    //tbondal

    Worked for me as well! Thank you very much.

    Is there an example of this usage in azure-pipelines.yml

    I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

    If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

    Was this page helpful?
    0 / 5 - 0 ratings