09:39
This commit is contained in:
@@ -125,7 +125,6 @@
|
||||
- "upgrade_cmd value: '{{ nb_upgrade_cmd }}'"
|
||||
- "len={{ nb_upgrade_cmd | length }}"
|
||||
|
||||
|
||||
# --- Parse the OK line robustly (token-based) ---
|
||||
- name: "NB preflight | Parse OK line (token)"
|
||||
when: nb_script.stat.exists
|
||||
@@ -635,6 +634,39 @@
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
# === NEW: Tag only when scheduling path ran (success gate same as scheduling) ===
|
||||
- name: Post | Build tag payload (auto-indoor-upgrade)
|
||||
when:
|
||||
- (dev1_read_ok | default(false)) and (dev2_read_ok | default(false))
|
||||
- (nb_upgrade_cmd | default('')) | length > 10
|
||||
- rmq_schedule_upgrade is defined
|
||||
delegate_to: localhost
|
||||
ansible.builtin.set_fact:
|
||||
tag_add_payload:
|
||||
inscope_device: "{{ ansible_hostname | default(inventory_hostname) }}"
|
||||
task_name: "tag_add"
|
||||
task_add1: "auto-indoor-upgrade"
|
||||
|
||||
- name: Post | Publish add-tag to controls
|
||||
when: tag_add_payload is defined
|
||||
delegate_to: localhost
|
||||
ansible.builtin.uri:
|
||||
url: "http://{{ rmq_host }}:{{ rmq_port }}/api/exchanges/{{ rmq_vhost | urlencode }}/{{ rmq_exchange | urlencode }}/publish"
|
||||
method: POST
|
||||
user: "{{ rmq_user }}"
|
||||
password: "{{ rmq_pass }}"
|
||||
force_basic_auth: true
|
||||
status_code: 200
|
||||
headers: { content-type: "application/json" }
|
||||
body_format: json
|
||||
body:
|
||||
properties: { content_type: "application/json" }
|
||||
routing_key: "{{ control_queue }}"
|
||||
payload: "{{ tag_add_payload | to_json }}"
|
||||
payload_encoding: "string"
|
||||
register: rmq_tag_add
|
||||
changed_when: (rmq_tag_add.json is defined) and (rmq_tag_add.json.routed | default(false) | bool)
|
||||
|
||||
- name: Post | Log upgrade scheduling response
|
||||
when: rmq_schedule_upgrade is defined
|
||||
delegate_to: localhost
|
||||
|
||||
Reference in New Issue
Block a user