No_log as variable not working

Hello all!

I am using no_log in my playbooks to include sensitive data but with the possibility to change this behavior with extra var. This is the task:

- name: "Playbook : include_global/inventory_vars_dir"
  ansible.builtin.include_vars:
    dir: "{{ item }}"
  with_items:
    - "vars/global"
    - "{{ 'vars/inventory/' + INVENTORY_NAME + '/global' }}"
  no_log: "{{ NO_LOG | default(true) | bool }}"

But even if I setup the NO_LOG var to false or remove the no_log line from task I’m getting this message:

ok: [host] => (item=None) => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false}

This is the ansible-playbook command:

ansible-playbook -i inventory.ini playbook-debug.yml -e @extra-vars.yml -vv

And this is the extra-vars.yml

---
NO_LOG: false

This are my pip package installed:

  • ansible==11.10.0
  • ansible-compat==25.8.1
  • ansible-core==2.18.9
  • ansible-lint==25.9.0

I’m using devContainer with python:3.13-slim as base image.

Thanks in advance!