Hi all,
I’ve noticed in a lot of cookbook code when needing the
cookbook name, folks have been using the hard coded string
name.
Eg. In the apache cookbook a defined attribute looks something
like this where ‘apache’ is listed 100s of times:
#default apache run directory
default['apache']['run_dir']
= '/var/run/httpd'
Instead of this:
#default apache run directory
default[cookbook_name]['run_dir'] = '/var/run/httpd’
Obviously, changing a cookbook name is not an everyday thing.
However we have a strict naming convention at our shop for
cookbooks to clarify the purpose of cookbook (eg. whether the
cookbook is a library, wrapper, policy, operating system, etc.).
And have had to change the name frequently initially to get
right.
Any thoughts on doing this? Are there drawbacks with
this?
Thanks,
Cliff