# No\_log as variable not working

**URL:** <https://forum.ansible.com/t/no-log-as-variable-not-working/44639>\
**Category:** Get Help\
**Created:** [October 8, 2025, 4:00pm UTC](https://forum.ansible.com/t/no-log-as-variable-not-working/44639 "2025-10-08T16:00:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmy-apena](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pmy-apena/32/9606_2.png) [@pmy-apena](https://forum.ansible.com/u/pmy-apena)\
**Post date:** [October 8, 2025, 4:00pm UTC](https://forum.ansible.com/t/no-log-as-variable-not-working/44639/1 "2025-10-08T16:00:46Z")

</div>

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:

```auto
- 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:

```auto
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:

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

```

And this is the extra-vars.yml

```auto
---
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!
