【发布时间】:2018-08-27 16:30:39
【问题描述】:
我有企业 GIT 和一个名为“Terraform”的公共存储库。我使用了下面的配置文件,并在执行路径下创建了一个名为“jaish”的文件夹。但是在以
身份运行 init 时收到错误消息"Error downloading modules: Error loading modules: error downloading 'https://github.XXX.com/<<user>>/Terraform': XML syntax error on line 34: expected element name after <"
provider "github" {
token = "XXXXXX"
}
module "jaish"{
source = "https://github.xxx.com/<<user>>/Terraform"
}
这里有什么遗漏吗?
【问题讨论】:
-
为什么要在这里定义
github提供者?这用于管理 Github 上的团队和存储库等,而不是用于下载项目。而且我认为您只想在此处删除https://前缀。 Terraform 默认使用 HTTPS 克隆 Github 链接,但您可以使用git@github.com:hashicorp/example.git使用 SSH 克隆 repo。如果您使用的是 Github Enterprise(域建议如此),那么您需要使用 Generic Git sourcing syntax -
仅限企业,我点击了您分享的最后一个链接。所以现在我在 .tf 中将此内容添加为“模块“consul”{ source =“git::github.XXX.com/user/Terraform.git”}”并收到错误为“下载模块时出错:加载模块时出错:模块 Terraform:未找到 Terraform 配置文件目录:.terraform\modules\00850326e3a1a85943eb26336ebc73d7"。我想我错过了模块“consul”的一些东西。我把它理解为 terraform 执行路径下的子文件夹....我需要为这个模块做任何额外的事情吗?
标签: git terraform terraform-template-file