diff --git a/files/ansible-playbooks/sot-updater.yml b/files/ansible-playbooks/sot-updater.yml index 06d9bfe..9fadb07 100644 --- a/files/ansible-playbooks/sot-updater.yml +++ b/files/ansible-playbooks/sot-updater.yml @@ -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','') }}" changed_when: false tasks: