From cf7bf30e05c714a1b2f64fdefa46e49f9ba3bae6 Mon Sep 17 00:00:00 2001 From: Raphael Dannecker Date: Mon, 15 Dec 2025 08:17:39 +0100 Subject: [PATCH] Make IP addresses of teacherpc configurable (for the firewall in exam mode) --- roles/lmn_exam/tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/lmn_exam/tasks/main.yml b/roles/lmn_exam/tasks/main.yml index d5610c2..1d0893e 100644 --- a/roles/lmn_exam/tasks/main.yml +++ b/roles/lmn_exam/tasks/main.yml @@ -52,10 +52,11 @@ - name: Append teacherPC to exam_destination_allowed_ipv4 addresses ansible.builtin.set_fact: - exam_destination_allowed_ipv4: "{{ exam_destination_allowed_ipv4 + [ ansible_default_ipv4.address.rsplit('.', 1)[0] ~ '.' ~ exam_teacherpc_last_digit ] }}" + exam_destination_allowed_ipv4: "{{ exam_destination_allowed_ipv4 + (exam_teacherpc_ips | default([ ansible_default_ipv4.address.rsplit('.', 1)[0] ~ '.' ~ exam_teacherpc_last_digit ])) }}" when: - exam_destination_allowed_ipv4 is defined - exam_destination_allowed_ipv4 | length > 0 + - exam_teacherpc_ips is defined or exam_teacherpc_last_digit | default('') | string | length > 0 - name: Install no-way-out-policy ansible.builtin.template: