diff options
Diffstat (limited to 'ansible/plays/ipam-generate-tf.yml')
-rw-r--r-- | ansible/plays/ipam-generate-tf.yml | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ansible/plays/ipam-generate-tf.yml b/ansible/plays/ipam-generate-tf.yml index f905b51..d9888b4 100644 --- a/ansible/plays/ipam-generate-tf.yml +++ b/ansible/plays/ipam-generate-tf.yml @@ -1,6 +1,10 @@ - hosts: localhost gather_facts: no connection: local + vars_files: + - ../group_vars/all/ipam.yml + collections: + - ansible.utils tasks: - name: Generate terraform/ipam6/ipam6.tf register: tf @@ -10,7 +14,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 }} = { @@ -18,14 +22,14 @@ description = "{{ network.description }}" {% endif %} range = "{{ network.range }}" - address = "{{ network.range|ipaddr("network") }}" - prefix = "{{ network.range|ipaddr("prefix") }}" + address = "{{ network.range|ansible.utils.ipaddr("network") }}" + prefix = "{{ network.range|ansible.utils.ipaddr("prefix") }}" {% set hosts = network.hosts|default({}) %} hosts = { {% for name, addr in hosts.items() %} {{ name }} = { - address: "{{ addr|ipaddr("address") }}" - prefix: "{{ addr|ipaddr("prefix") }}" + address: "{{ addr|ansible.utils.ipaddr("address") }}" + prefix: "{{ addr|ansible.utils.ipaddr("prefix") }}" } {% endfor %} } @@ -40,8 +44,8 @@ {% set hosts = network.hosts|default({}) %} {% for name, addr in hosts.items() %} {{ name }} = { - address: "{{ addr|ipaddr("address") }}" - prefix: "{{ addr|ipaddr("prefix") }}" + address: "{{ addr|ansible.utils.ipaddr("address") }}" + prefix: "{{ addr|ansible.utils.ipaddr("prefix") }}" } {% endfor %} {% endfor %} |