This commit is contained in:
2026-02-25 17:51:50 +02:00
parent 18840e368b
commit a289bfc167

View File

@@ -308,12 +308,23 @@
when:
- nb_cf_lookup is defined
- (nb_cf_lookup.status | default(0)) == 200
- (nb_cf_lookup.json.results | default([]) | length) > 0
- (nb_cf_lookup.content | default('') | length) > 0
delegate_to: localhost
vars:
nb_cf_json: "{{ nb_cf_lookup.json | default(nb_cf_lookup.content | from_json) }}"
set_fact:
nb_baseline_ok: true
nb_device_id: "{{ nb_cf_lookup.json.results[0].id | default('') }}"
nb_custom_fields_current: "{{ nb_cf_lookup.json.results[0].custom_fields | default({}) }}"
nb_device_id: "{{ nb_cf_json.results[0].id | default('') }}"
nb_custom_fields_current: "{{ nb_cf_json.results[0].custom_fields | default({}) }}"
changed_when: false
- name: NB baseline | Debug baseline ok and a sample key
delegate_to: localhost
debug:
msg:
- "nb_baseline_ok={{ nb_baseline_ok }}"
- "nb_device_id={{ nb_device_id }}"
- "baseline fw_version={{ nb_custom_fields_current.get('fw_version','<missing>') }}"
changed_when: false
tasks: