1559
This commit is contained in:
@@ -470,6 +470,74 @@
|
||||
payload_encoding: "string"
|
||||
changed_when: false
|
||||
|
||||
# ----------------------- Dev1 bootbanks backup firmux → fw_version_backup -----------------------
|
||||
- name: Dev1 | Read bootbanks backup firmux via jq
|
||||
delegate_to: localhost
|
||||
shell: |
|
||||
sshpass -p '{{ dev1_pass }}' ssh {{ ssh_opts_common }} \
|
||||
"{{ dev1_user }}@{{ ansible_host|default(inventory_hostname) }}" \
|
||||
"jq -r '.backup.firmux // empty' /var/run/bootbanks.json 2>/dev/null || true"
|
||||
register: dev1_fw_backup_raw
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
ignore_errors: true
|
||||
|
||||
- name: Dev1 | Normalize fw_version_backup value
|
||||
delegate_to: localhost
|
||||
set_fact:
|
||||
fw_version_backup_value: >-
|
||||
{{
|
||||
(dev1_fw_backup_raw.stdout | default('') | trim)
|
||||
if ((dev1_fw_backup_raw.stdout | default('') | trim | length) > 0)
|
||||
else 'unavailable'
|
||||
}}
|
||||
|
||||
- name: Dev1 | fw_version_backup raw debug
|
||||
delegate_to: localhost
|
||||
debug:
|
||||
msg:
|
||||
- "dev1_fw_backup_raw.rc={{ dev1_fw_backup_raw.rc | default('n/a') }}"
|
||||
- "dev1_fw_backup_raw.stdout={{ dev1_fw_backup_raw.stdout | default('') | trim }}"
|
||||
- "dev1_fw_backup_raw.stderr={{ dev1_fw_backup_raw.stderr | default('') | trim }}"
|
||||
|
||||
- name: Dev1 | fw_version_backup final debug
|
||||
delegate_to: localhost
|
||||
debug:
|
||||
msg:
|
||||
- "fw_version_backup_value={{ fw_version_backup_value | default('unset') }}"
|
||||
|
||||
|
||||
- name: Scan tracking | Dev1 fw_version_backup outcome
|
||||
delegate_to: localhost
|
||||
set_fact:
|
||||
scan_ok: "{{ scan_ok + (['fw_version_backup'] if ((fw_version_backup_value | default('unavailable')) != 'unavailable') else []) }}"
|
||||
scan_fail: "{{ scan_fail + (['fw_version_backup=unavailable'] if ((fw_version_backup_value | default('unavailable')) == 'unavailable') else []) }}"
|
||||
changed_when: false
|
||||
|
||||
- name: Publish Dev1 fw_version_backup
|
||||
delegate_to: localhost
|
||||
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: "{{ {
|
||||
'inscope_device': (ansible_hostname|default(inventory_hostname)),
|
||||
'task_name': 'custom_field_set',
|
||||
'task_add1': 'fw_version_backup',
|
||||
'task_result': fw_version_backup_value
|
||||
} | to_json }}"
|
||||
payload_encoding: "string"
|
||||
changed_when: false
|
||||
|
||||
|
||||
# ----------------------- Dev1 SSID count (jq-based, schema-aware) -----------------------
|
||||
- name: Dev1 | SSID profiles summary via jq (AP radios only)
|
||||
delegate_to: localhost
|
||||
|
||||
Reference in New Issue
Block a user