This commit is contained in:
2025-11-04 09:31:28 +02:00
parent 5d04bb0f7d
commit 44c3965494
2 changed files with 325 additions and 0 deletions

View File

@@ -37,6 +37,35 @@
rmq_exchange: "{{ lookup('env','RMQ_EXCHANGE') | default('controls', true) }}"
control_queue: "{{ lookup('env','CONTROLQUEUE') | default('queue_controls', true) }}"
pre_tasks:
- name: "NB preflight | Run netbox_one_device.py for {{ inventory_hostname }} (chatty)"
delegate_to: localhost
environment:
PYTHONUNBUFFERED: "1" # make Python flush immediately
args:
chdir: "/opt/containers/ansible-worker/app"
shell: |
set -o pipefail
python3 netbox_one_device.py "{{ inventory_hostname }}" --chatty 2>&1
register: nb_preflight
changed_when: false # informational only
failed_when: false # soft-fail, keep going
- name: "NB preflight | Print chatty output"
delegate_to: localhost
ansible.builtin.debug:
msg: >-
{{
(nb_preflight.stdout_lines | default([])) |
map('regex_replace', '^(.*)$', 'NB | \\1') |
list
}}
- name: "NB preflight | Pause 1s"
delegate_to: localhost
ansible.builtin.pause:
seconds: 1
tasks:
- name: "⚙️ Start | Dev1 banner → tunnel/auth → Dev2 firmux (telemetry mode)"
debug: