Skip to content

Commit

Permalink
Merge pull request #11 from valiantlynx/working
Browse files Browse the repository at this point in the history
ok test yml
valiantlynx authored Mar 24, 2024
2 parents 852fc0f + 727b782 commit e704066
Showing 2 changed files with 13 additions and 23 deletions.
11 changes: 0 additions & 11 deletions ansible/vars/cloudflare_vars.yml

This file was deleted.

25 changes: 13 additions & 12 deletions terraform/modules/ec2/main.tf
Original file line number Diff line number Diff line change
@@ -32,26 +32,27 @@ data "template_file" "cloudflare_vars" {
template = <<-EOT
---
cloudflare_zone_ids:
%{ for domain, details in var.cloudflare_zone_ids ~}
%{ if details.include_root ~}
%{ for domain, details in var.cloudflare_zone_ids ~}
%{ if details.include_root ~}
"${domain}":
zone_id: "${details.zone_id}"
service: "${details.service}"
port: ${details.port}
%{ endif ~}
%{ if details.include_subdomains ~}
%{ for subdomain in details.subdomains ~}
"${subdomain.name}.${domain}":
zone_id: "${details.zone_id}"
service: "${subdomain.service}"
port: ${subdomain.port}
%{ endfor ~}
%{ endif ~}
%{ endfor ~}
%{ endif ~}
%{ if details.include_subdomains ~}
%{ for subdomain in details.subdomains ~}
"${subdomain.name}.${domain}":
zone_id: "${details.zone_id}"
service: "${subdomain.service}"
port: ${subdomain.port}
%{ endfor ~}
%{ endif ~}
%{ endfor ~}
EOT
}



resource "local_file" "cloudflare_vars_file" {
filename = "${abspath(path.module)}/../../../ansible/vars/cloudflare_vars.yml"
content = data.template_file.cloudflare_vars.rendered

0 comments on commit e704066

Please sign in to comment.