jinja2-cli icon indicating copy to clipboard operation
jinja2-cli copied to clipboard

Support for recursively replacing variables

Open pravindahal opened this issue 8 years ago • 6 comments

Please see example in tests.

I am not convinced this is the correct way to go about it though.

pravindahal avatar Feb 02 '17 23:02 pravindahal

What's the usecase for this? I get what it's doing, I just can't think of why I'd want to use this.

mattrobenolt avatar Feb 02 '17 23:02 mattrobenolt

I was trying to use the tool on this template using this yml which didn't work as expected. This is an ansible template which uses Jinja2 with support for recursive evaluation.

pravindahal avatar Feb 02 '17 23:02 pravindahal

I'm going to probably pull this in later. Do you have a preference on it being a CLI argument? To be, it seems like we could just allow this behavior all the time. I don't see any real cases where this would cause an issue unexpectedly.

mattrobenolt avatar Feb 15 '17 21:02 mattrobenolt

I'd vote to have it available all the time, i.e. directly integrated in the jinja lib. I've had to implement a similar thing in a python script of mine, whereas I could have just added a recursive=True param to the template.render() call if this had been available.

afeblot avatar Oct 05 '17 13:10 afeblot

Hi all, any chance we could merge this?

hvtuananh avatar Jun 10 '19 15:06 hvtuananh

Bump, this would be great

rosstex avatar Feb 28 '21 20:02 rosstex