aboutsummaryrefslogtreecommitdiff
path: root/ansible/plays
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2024-09-24 22:37:01 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2024-09-24 22:37:01 +0200
commit5237db91a43e04bf7535056ccbd42edbe7f5d1f8 (patch)
treed6bc7c18b754dc965a90300c731ace3b9f7e784f /ansible/plays
parent61817c6a3a07aadd5608939ba8dded4a1e77c7ae (diff)
downloadinfra-5237db91a43e04bf7535056ccbd42edbe7f5d1f8.tar.gz
infra-5237db91a43e04bf7535056ccbd42edbe7f5d1f8.tar.bz2
infra-5237db91a43e04bf7535056ccbd42edbe7f5d1f8.tar.xz
infra-5237db91a43e04bf7535056ccbd42edbe7f5d1f8.zip
ipam
Diffstat (limited to 'ansible/plays')
-rw-r--r--ansible/plays/ipam-generate-dns.yml7
-rw-r--r--ansible/plays/ipam-generate-tf.yml4
2 files changed, 9 insertions, 2 deletions
diff --git a/ansible/plays/ipam-generate-dns.yml b/ansible/plays/ipam-generate-dns.yml
index 7bdbfaa..d29b3e8 100644
--- a/ansible/plays/ipam-generate-dns.yml
+++ b/ansible/plays/ipam-generate-dns.yml
@@ -22,6 +22,11 @@
{% endfor %}
- debug:
msg: "{{ content }}"
- - copy:
+ when: false
+ - name: Generating ../../terraform/dns/dn42.tf
+ register: tf
+ copy:
dest: ../../terraform/dns/dn42.tf
content: "{{ content }}"
+ - shell: terraform fmt ../../terraform/ipam6/ipam6.tf
+ when: "tf.changed"
diff --git a/ansible/plays/ipam-generate-tf.yml b/ansible/plays/ipam-generate-tf.yml
index f905b51..e43a559 100644
--- a/ansible/plays/ipam-generate-tf.yml
+++ b/ansible/plays/ipam-generate-tf.yml
@@ -1,6 +1,8 @@
- hosts: localhost
gather_facts: no
connection: local
+ collections:
+ - ansible.utils
tasks:
- name: Generate terraform/ipam6/ipam6.tf
register: tf
@@ -10,7 +12,7 @@
output "networks" {
value = {
{% for name, network in ipam6.networks.items() %}
- {% if not (network.range | ipv6) %}
+ {% if not (network.range | ansible.utils.ipv6) %}
Invalid network: {{ network.range }}
{% endif %}
{{ name }} = {