diff --git a/host_vars/competitorsvcs.studentrobotics.org.yml b/host_vars/competitorsvcs.studentrobotics.org.yml index ca2cc0d..adc169e 100644 --- a/host_vars/competitorsvcs.studentrobotics.org.yml +++ b/host_vars/competitorsvcs.studentrobotics.org.yml @@ -13,5 +13,4 @@ certbot_certs: - "{{ canonical_hostname }}" # Mythic have additionally routed this IP to the VM -clatd_conf: | - clat-v6-addr=2a00:1098:80:bc::2 +clat_v6_addr: 2a00:1098:80:bc::2 diff --git a/roles/clatd/README.md b/roles/clatd/README.md index 9aa9484..00e7f8c 100644 --- a/roles/clatd/README.md +++ b/roles/clatd/README.md @@ -4,4 +4,4 @@ A CLAT / SIIT-DC Edge Relay implementation for Linux. Used to provide IPv4 outbound connectivity to an IPv6-only VM. -It's likely `clat-v6-addr` will need to be configured to assign the correct IP to the created `clat` interface. This may require an additional IPv6 address be routed to the VM. This is configured with the `clatd_conf` variable. +It's likely `clat-v6-addr` will need to be configured to assign the correct IP to the created `clat` interface. This may require an additional IPv6 address be routed to the VM. diff --git a/roles/clatd/defaults/main.yml b/roles/clatd/defaults/main.yml deleted file mode 100644 index 66f3064..0000000 --- a/roles/clatd/defaults/main.yml +++ /dev/null @@ -1 +0,0 @@ -clatd_conf: "" diff --git a/roles/clatd/tasks/main.yml b/roles/clatd/tasks/main.yml index 7b3d624..cbec919 100644 --- a/roles/clatd/tasks/main.yml +++ b/roles/clatd/tasks/main.yml @@ -36,8 +36,8 @@ when: install_clatd.changed # noqa: no-handler - Use a handler to ensure execution order - name: Install configuration - copy: - content: "{{ clatd_conf }}" + template: + src: clatd.conf dest: /etc/clatd.conf mode: "0644" notify: Restart clatd diff --git a/roles/clatd/templates/clatd.conf b/roles/clatd/templates/clatd.conf new file mode 100644 index 0000000..b36510d --- /dev/null +++ b/roles/clatd/templates/clatd.conf @@ -0,0 +1,3 @@ +{% if clat_v6_addr is defined %} +clat-v6-addr={{ clat_v6_addr }} +{% endif %}