diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-23 15:05:10 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-23 15:05:10 +0100 |
commit | b8aea45af19d61a51ab0f568aee8e2e731dccaa7 (patch) | |
tree | fd8eb583f99200eb7703adfec7fd793e59b38e37 /j2 | |
parent | 2616847e01f34926f80da6b9661bf1c08e67722f (diff) | |
parent | e2f4aefa956bb06b1ee52d95ad8275757605678d (diff) | |
download | rules-sandbox-b8aea45af19d61a51ab0f568aee8e2e731dccaa7.tar.gz rules-sandbox-b8aea45af19d61a51ab0f568aee8e2e731dccaa7.tar.bz2 rules-sandbox-b8aea45af19d61a51ab0f568aee8e2e731dccaa7.tar.xz rules-sandbox-b8aea45af19d61a51ab0f568aee8e2e731dccaa7.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'j2')
-rw-r--r-- | j2/dba/cluster.j2 | 19 | ||||
-rw-r--r-- | j2/terraform-machine.j2 | 2 | ||||
-rw-r--r-- | j2/wireguard/ansible-host.j2 | 8 | ||||
-rw-r--r-- | j2/wireguard/inventory.j2 | 8 |
4 files changed, 29 insertions, 8 deletions
diff --git a/j2/dba/cluster.j2 b/j2/dba/cluster.j2 new file mode 100644 index 0000000..045fbcd --- /dev/null +++ b/j2/dba/cluster.j2 @@ -0,0 +1,19 @@ +# Generated + +# cluster: {{ cluster.name }} +{%- for m, containers in containersByMachine.entrySet() %} +--- +- host: + - {{ m.name }} + tasks: + import_role: + name: docker-service + vars: + template: | + version: "3" + services: +{%- for c in containers %} + {{ c.name }}: + image: {{ c.image }}:{{ c.tag }} +{%- endfor %} +{% endfor %} diff --git a/j2/terraform-machine.j2 b/j2/terraform-machine.j2 index c83bc48..0ac8b90 100644 --- a/j2/terraform-machine.j2 +++ b/j2/terraform-machine.j2 @@ -11,7 +11,7 @@ resource "scaleway_instance_ip" "{{ scw.key }}" {} resource "scaleway_instance_ip_reverse_dns" "{{ scw.key }}" { ip_id = scaleway_instance_ip.{{ scw.key }}.id - reverse = "{{ m.fqdn }}" + reverse = "{{ m.fqdn }}." } output "{{scw.key}}_public_ip" { diff --git a/j2/wireguard/ansible-host.j2 b/j2/wireguard/ansible-host.j2 index 72273ef..a3c8c40 100644 --- a/j2/wireguard/ansible-host.j2 +++ b/j2/wireguard/ansible-host.j2 @@ -1,8 +1,8 @@ # Generated -link_address: {{ link }} -network_cidr: {{ network }} +link_address: {{ host.ip }} +network_cidr: {{ host.networkCidr }} wireguard_peers: - {{ host.name }}: + {{ host.machine.name }}: {%- for peer in peers %} - - {{ peer }} + - {{ peer.fqdn }} {%- endfor %} diff --git a/j2/wireguard/inventory.j2 b/j2/wireguard/inventory.j2 index c7f38ee..0924bb2 100644 --- a/j2/wireguard/inventory.j2 +++ b/j2/wireguard/inventory.j2 @@ -1,5 +1,7 @@ # Generated all: -{%- for host in hosts %} - {{ host.name }}: {{ host.fqdn }} -{%- endfor %} + hosts: + {%- for host in hosts %} + {{ host.getName() }}: + ansible_host: {{ host.getFqdn() }} + {%- endfor %} |