diff --git a/files/ansible-playbooks/sot-updater-upgradecmd.yml b/files/ansible-playbooks/sot-updater-upgradecmd.yml index 3270f96..301630c 100644 --- a/files/ansible-playbooks/sot-updater-upgradecmd.yml +++ b/files/ansible-playbooks/sot-updater-upgradecmd.yml @@ -79,6 +79,34 @@ - "{{ (nb_preflight.stderr_lines | default([''])) }}" - "raw stdout (joined): {{ nb_preflight.stdout | default('') | trim }}" + # --- Debug-only: capture the exact upgrade_cmd line and stop the play --- + - name: "NB preflight | Extract exact upgrade_cmd line" + when: nb_script.stat.exists + delegate_to: localhost + ansible.builtin.set_fact: + nb_upgrade_line: >- + {{ + ( + nb_preflight.stdout_lines | default([]) | map('regex_replace','\r','') | map('trim') + | select('match', '^NB:\s*upgrade_cmd\s*=') + | list | first + ) | default('') + }} + + - name: "NB preflight | Show captured upgrade_cmd line" + when: nb_script.stat.exists + delegate_to: localhost + ansible.builtin.debug: + msg: + - "upgrade_cmd line (exact): {{ nb_upgrade_line | default('') }}" + - "found? {{ (nb_upgrade_line | length) > 0 }}" + + - name: "NB preflight | STOP here (temporary)" + meta: end_play + + + + # --- Parse the OK line robustly (token-based) --- - name: "NB preflight | Parse OK line (token)" when: nb_script.stat.exists