Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

FC035 - Templates, Style #62

miketheman opened this Issue Aug 29, 2012 · 2 comments


None yet
2 participants

miketheman commented Aug 29, 2012

As discussed in #60, the FC035 rule needs some RFC discussion.

There is some reasoning behind not including computations in a template file, and other reasons for including node attributes in the template file.

An example of how a node's attribute could be mutated between the time a template resource declaration and the rendering of said resource is here. This is somewhat a contrived example, and doing this is itself probably an anti-pattern to be mindful of.

This issue is to discuss what should probably be in FC035's logic.


acrmp commented Aug 29, 2012

Hi Mike,

Thanks for kicking this off.

  • Passing in a subset (node['ntp']) is more explicit for complex / long templates because you can see more easily what is being accessed. We could check to see if all your attribute usage in the template (ignoring hostname etc) is under a common attribute parent and recommend this. This makes more sense the deeper the level of attribute nesting.
  • If the template only uses a couple of node attributes then passing them individually as variables is a bit more explicit but probably not worth warning for.




miketheman commented Nov 28, 2015

It's been a few years, and I think we've settled into a good enough pattern on when to use node attributes directly in a template vs when not to. Closing

@miketheman miketheman closed this Nov 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment