#Ansible's decision to use Jinja in values only, and not render the YAML itself through Jinja (like Salt does) might make some things a bit more clean, but it also makes a _lot_ of things significantly more difficult. 😩

Hot take: Infrastructure as Code should mean actual _code_, not YAML.

Don't get me wrong: I'm one of the few people who actually like YAML. But trying to express actual _logic_ in YAML, like conditions, or value lookups, or loops, gets really messy really fast.

Just let me write my infrastructure in actual Python (or whatever). It can still be declarative, with all the state comparison and dependency resolving going on in the background.

But YAML is not the way.

@scy maybe Pulumi is what you’re looking for?
https://www.pulumi.com/
Infrastructure as Code Platform with Agentic AI – Pulumi

Pulumi is an infrastructure management platform to automate through infrastructure as code, secure with secrets management, and manage infrastructure with AI.

pulumi