confused about | mandatory

What is the scope to which |mandatory applies? It seems that debug is not one of them:

`
vars:
vi_tenant: “{{ tenant | mandatory }}”
vi_plants: “{{ plants | mandatory }}”

status: |
Provisioning tenant security:
env {{env}}
tenant {{vi_tenant}}
plants {{vi_plants}}

tasks:

  • debug: var=status.split(‘\n’)

`

TASK: [debug var=status.split('\n')] ****************************************** ok: [localhost] => { "var": { "status.split('\\n')": [ "Provisioning tenant security:", "env staging", "tenant tenantA", "plants {{ plants | mandatory }}" ] } }

Why doesn’t the |mandatory fail in this case?. On top of that I am using ‘error_on_undefined_vars = True’

But that also seems to have no effect here as well.

mandatory is only needed if error_on_undefined_vars=False (which was
the default long ago)

what version of ansible? os? python?

os: ubuntu 14.04
ansible 1.9.2-rc2 (but maybe 1.9.2-rc1)
python: 2.7.63

So I had not used the feature in a while, it seems that it is currently broken:

https://github.com/ansible/ansible/issues/10136