This commit is contained in:
2025-11-04 16:38:19 +02:00
parent afd365ffb0
commit 7f2f622124

View File

@@ -137,19 +137,19 @@
# --- If IP changed → publish a 3s delayed 'sot-updater' task and stop this host ---
- name: "NB preflight | Publish delayed requeue (3s) and stop" - name: "NB preflight | Publish delayed requeue (3s) and stop"
when: when:
- nb_script.stat.exists - nb_script.stat.exists
- nb_ip_changed | default(false) - nb_ip_changed | default(false)
delegate_to: localhost delegate_to: localhost
uri: uri:
url: "http://localhost:15672/api/exchanges/app/deviceconfig.delayed/publish" url: "http://{{ rmq_host }}:{{ rmq_port }}/api/exchanges/app/deviceconfig.delayed/publish"
method: POST method: POST
user: "admin" user: "admin"
password: "change_me" password: "change_me"
force_basic_auth: true force_basic_auth: true
status_code: 200 status_code: 200
return_content: yes # <-- make response body available
headers: headers:
content-type: "application/json" content-type: "application/json"
body_format: json body_format: json
@@ -171,7 +171,11 @@
- nb_ip_changed | default(false) - nb_ip_changed | default(false)
delegate_to: localhost delegate_to: localhost
ansible.builtin.debug: ansible.builtin.debug:
var: rmq_requeue.json msg:
- "RMQ publish URL: http://{{ rmq_host }}:{{ rmq_port }}/api/exchanges/app/deviceconfig.delayed/publish"
- "HTTP status: {{ rmq_requeue.status | default('unknown') }}"
- "Parsed JSON: {{ rmq_requeue.json | default('<none>') }}"
- "Raw content: {{ rmq_requeue.content | default('<none>') }}"
- name: "NB preflight | Stop further tasks for this host" - name: "NB preflight | Stop further tasks for this host"
when: when: