debops/debops-playbooks

Avoid redundand fallback defaults in templates if they are already in defaults/main.yml

ypid opened this issue ยท 3 comments

ypid commented

Example: "nginx_hsts_age | default('15768000')" in debops.nginx

I have seen that a number of times in DebOps but I think it does not add much value other than maintenance overhead ;). Thoughts?

Agreed. Defaults in templates aren't easily changed by the user, so we can drop them and rely on the variables being present in defaults/main.yml. In the specific debops.nginx case and nginx.conf template I was trying to make the number of the variables in defaults smaller, hoping that the user could add their overrides for variables set there through the inventory anyway. But I guess that I just need to get used to long defaults/main.yml files instead. :-)

ypid commented

All right. I guess you can set this to "approved" then ๐Ÿ˜‰

But I guess that I just need to get used to long defaults/main.yml files instead. :-)

Thats what we now have tables of contents in rendered docs and Vim folds in raw files for ๐Ÿ˜„

Edit: Added "now". DebOps is rapidly evolving and some things would be done differently now.

@ypid Yup, I know. I wasn't using them back then. :-)