From 9851dffc8d915ff01117a5ed8070e5b2a1ef2bb5 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 28 Dec 2020 21:56:05 +0100 Subject: Better structure. Splitting machines and terraform machines, ditto with dns. --- j2/platform-ansible.j2 | 5 +++++ j2/terraform-machine.j2 | 11 ----------- j2/terraform-record-set.j2 | 8 ++++++++ 3 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 j2/terraform-record-set.j2 (limited to 'j2') diff --git a/j2/platform-ansible.j2 b/j2/platform-ansible.j2 index 686275d..72e3247 100644 --- a/j2/platform-ansible.j2 +++ b/j2/platform-ansible.j2 @@ -1 +1,6 @@ # Ansible +- hosts: + - {{ m.key }} + tasks: + - import_role: + name: acme-platform diff --git a/j2/terraform-machine.j2 b/j2/terraform-machine.j2 index 7a00001..e6f0fe9 100644 --- a/j2/terraform-machine.j2 +++ b/j2/terraform-machine.j2 @@ -13,14 +13,3 @@ resource "scaleway_instance_ip_reverse_dns" "{{ m.key }}" { ip_id = scaleway_instance_ip.{{ m.key }}.id reverse = "{{ m.key }}.${google_dns_managed_zone.machine.dns_name}" } - -resource "google_dns_record_set" "{{ m.key }}" { - name = "{{ m.key }}.${google_dns_managed_zone.machine.dns_name}" - managed_zone = google_dns_managed_zone.machine.name - type = "A" - ttl = 300 - - rrdatas = [scaleway_instance_ip.{{ m.key }}.public_ip] - - depends_on = [google_dns_managed_zone.ci] -} diff --git a/j2/terraform-record-set.j2 b/j2/terraform-record-set.j2 new file mode 100644 index 0000000..7dea150 --- /dev/null +++ b/j2/terraform-record-set.j2 @@ -0,0 +1,8 @@ +resource "google_dns_record_set" "{{ m.key }}" { + name = "{{ m.fqdn }}" + managed_zone = "{{ m.terraformManagedZone }}" + type = "{{ m.rrType }}" + ttl = 300 + + rrdatas = [{{ m.terraformIp }}] +} -- cgit v1.2.3