This commit is contained in:
2026-02-12 09:01:15 +02:00
parent 9a0888cec9
commit 0b79d9dbfc
2 changed files with 177 additions and 5 deletions

View File

@@ -3,8 +3,7 @@
# Phase 1: Cloud -> NetBox sync (via sot-updater-iponly.yml in wrapper mode)
# Phase 2: Refresh ansible_host from nb_ip, reset_connection
# Phase 3: Run update-rebootin224.yml
# NOTE: update-rebootin224.yml is responsible for scheduling afterupgrade_check via RabbitMQ (delayed).
# Do NOT import/run afterupgrade_check.yml here.
# Phase 4: Run afterupgrade_check.yml
- hosts: all
gather_facts: no
@@ -42,9 +41,7 @@
_lines: "{{ (nb_preflight.stdout_lines | default([])) | map('regex_replace','\r','') | map('trim') | list }}"
_ok_line: "{{ (_lines | select('match','^OK\\s+') | list | last | default('')) }}"
_fail_line: "{{ (_lines | select('match','^FAIL\\s+') | list | last | default('')) }}"
# NOTE: regex_search with a replacement can yield a list on some Ansible/Jinja versions;
# keep it as a plain string match for ansible_host.
_ip_raw: "{{ _ok_line | regex_search('([0-9]{1,3}(?:\\.[0-9]{1,3}){3})') | default('') }}"
_ip_raw: "{{ _ok_line | regex_search('([0-9]{1,3}(?:\\.[0-9]{1,3}){3})','\\1') | default('') }}"
set_fact:
nb_ip: "{{ _ip_raw }}"
nb_ip_ok: "{{ (_ip_raw | length) > 0 }}"
@@ -66,3 +63,5 @@
- import_playbook: update-rebootin224.yml
vars:
is_run_by: "scheduler"