terraform: generate conf with http backend
This commit is contained in:
parent
affa0f0149
commit
32239c379a
16 changed files with 43 additions and 4 deletions
|
@ -50,6 +50,12 @@ class ListAutomation(TerraformAutomation):
|
|||
MirrorList.provider == self.provider,
|
||||
).all(),
|
||||
global_namespace=app.config['GLOBAL_NAMESPACE'],
|
||||
terraform_modules_path=os.path.join(*list(os.path.split(app.root_path))[:-1], 'terraform-modules'),
|
||||
backend_config=f"""backend "http" {{
|
||||
lock_address = "{app.config['TFSTATE_BACKEND']}/{self.short_name}"
|
||||
unlock_address = "{app.config['TFSTATE_BACKEND']}/{self.short_name}"
|
||||
address = "{app.config['TFSTATE_BACKEND']}/{self.short_name}"
|
||||
}}""",
|
||||
**{
|
||||
k: app.config[k.upper()]
|
||||
for k in self.template_parameters
|
||||
|
|
|
@ -17,6 +17,7 @@ class ListGithubAutomation(ListAutomation):
|
|||
|
||||
template = """
|
||||
terraform {
|
||||
{{ backend_config }}
|
||||
required_providers {
|
||||
github = {
|
||||
source = "integrations/github"
|
||||
|
|
|
@ -16,6 +16,7 @@ class ListGitlabAutomation(ListAutomation):
|
|||
|
||||
template = """
|
||||
terraform {
|
||||
{{ backend_config }}
|
||||
required_providers {
|
||||
gitlab = {
|
||||
source = "gitlabhq/gitlab"
|
||||
|
|
|
@ -13,6 +13,7 @@ class ListS3Automation(ListAutomation):
|
|||
|
||||
template = """
|
||||
terraform {
|
||||
{{ backend_config }}
|
||||
required_providers {
|
||||
aws = {
|
||||
version = "~> 4.4.0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue