Jinja Default Template Error in Devel Branch

I have this statement in my yaml file:

`
{{spec.selector.name|default(metadata.name)}}

`

I just started noticing it is failing when the spec.selector.name is not available or undefined, it doesn’t seem to go to the default. This doesn’t happen for me on 2.1, but wasn’t sure if something changed in devel or this is a bug.

Thanks!

Steven

Is this in a playbook or a role (or something else?).

Is this vault encrypted yaml file?

If you are setup to test an ansible version from git, can you test a few
different older commits?

My list of suspects would start with recent changes to lib/ansible/template:

d52a9cee46553dc461a0bc69bb0459d5f2eb6765
4ed88512e45112f9670560ac3f01707a40a7f5c5
ff34f5548ddde266742bee2765f32af2828c5ee7
e396d5d508ecb9ca7699dc1e7c9f554f51667c8e
56148291e99ebac0979e4866e26fefaf88fec024

This is was in a regular task that I had as a conditional.

I went to the other commits, and the following commits worked as I they did in 2.1:

d52a9cee46553dc461a0bc69bb0459d5f2eb6765 4ed88512e45112f9670560ac3f01707a40a7f5c5
ff34f5548ddde266742bee2765f32af2828c5ee7
e396d5d508ecb9ca7699dc1e7c9f554f51667c8e

The last commit you had above, didn’t even fully run the playbook, so there might be something else wrong with that one, this was the commit just for posterity:

`
56148291e99ebac0979e4866e26fefaf88fec024

`

Let me know if you need any more information. Thanks!

Slight caveat to that, I don’t use that template in a conditional, just in a normal shell task in order to pass in a variable to a shell script. It does work in the other commit versions that you provided, like I stated above though.

More information on this one, as I use the jinja filter in a file the default isn’t working either.