I put together a quick video on one of my favorite (and, in my opinion, underrated) Ansible features: default(omit).
It’s a simple trick that lets you completely omit a module parameter when a variable isn’t defined, instead of passing an empty value. I use it all the time to make playbooks more reusable and avoid extra when statements or duplicate tasks.
The video is under 3 minutes and includes a simple localhost demo using the copy module to show how it works.
I’m curious, what’s your favorite “hidden gem” in Ansible that more people should know about? I’m looking for ideas for future shorts.