From 88f01bc08464589c79ec4c594d54b02b747486f2 Mon Sep 17 00:00:00 2001 From: pavel Date: Mon, 26 Jan 2026 17:44:14 +0200 Subject: [PATCH] 1744 --- .../ptsd_reacquire_attempt.yml | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/files/ansible-playbooks/ptsd_reacquire_attempt.yml b/files/ansible-playbooks/ptsd_reacquire_attempt.yml index 6f93ac2..2e4fce0 100644 --- a/files/ansible-playbooks/ptsd_reacquire_attempt.yml +++ b/files/ansible-playbooks/ptsd_reacquire_attempt.yml @@ -535,6 +535,41 @@ when: not (dhcp_migrated_ok | bool) ansible.builtin.meta: end_host + - name: CASE A DEV2 run config-test check before reboot cancellation + when: dhcp_migrated_ok | bool + delegate_to: localhost + ansible.builtin.shell: | + set -e + export DEV2_CMD="/usr/sbin/config-test.lua -c >/dev/null 2>&1 && echo OK || echo FAIL" + {{ dev2_exec_cmd }} + args: { executable: /bin/bash } + register: config_test_check + changed_when: false + failed_when: false + + - name: CASE A set config-test check status + when: dhcp_migrated_ok | bool + delegate_to: localhost + ansible.builtin.set_fact: + config_test_ok: "{{ (config_test_check.stdout | default('') | trim) == 'OK' }}" + changed_when: false + + - name: CASE A append config-test check result + when: dhcp_migrated_ok | bool + delegate_to: localhost + ansible.builtin.set_fact: + cleanup_report: >- + {{ + cleanup_report + ~ ', ' + ~ ( + 'config-test -c ok' + if (config_test_ok | bool) + else 'config-test -c failed' + ) + }} + changed_when: false + - name: CASE A Initialize cumulative cleanup report when: dhcp_migrated_ok | bool delegate_to: localhost @@ -555,7 +590,7 @@ failed_when: false - name: CASE A DEV2 cancel reboot if present - when: dhcp_migrated_ok | bool and (reboot_present.stdout | default('') | trim) == "FOUND" + when: dhcp_migrated_ok | bool and (config_test_ok | bool) and (reboot_present.stdout | default('') | trim) == "FOUND" delegate_to: localhost ansible.builtin.shell: | set -e