Modifying the file specificity search path


#1

Howdy, all –

Is there a way I can make the next item in the file specificity search path
after “#{node[:platform]}-#{node[:platform_version]}” be
"#{node[:platform]}-#{node[:platform_version].split(’.’)[0]}"?

The current behavior (if I understand it from the documentation correctly)
doesn’t really make sense for a lot of cases – as minor version numbers for
RHEL-derived distributions update as time goes on when doing regular
stability-and-security updates with no action taken by the user, cookbooks
currently can break for no reason other than a new upstream install image
being available (the file you needed is suddenly being looked for in
centos-5.6/foo rather than centos-5.5/foo, though all you really needed
was to distinguish the centos-5 version from the centos-6 version). Having a
major-version-only path entry thus makes sense; can this be accomplished
without patching Chef?

Thanks!


#2

Agreed, the way I’ve dealt with this is use a platform specific folder
(centos|redhat) and have a -5 and -6 template available. Then select
the template “source” with a platform_version.to_i or a .split, as you
chose.

Eric G. Wolfe
Senior Linux Administrator,
IT Infrastructure Systems

Marshall University Computing Services
Drinko Library 428-K
One John Marshall Dr.
Huntington, WV 25755
Phone: 304.696.3428
Email: eric.wolfe@marshall.edu

Coding is easy; All you do is sit staring at a terminal until the drops
of blood form on your forehead.

On 07/25/2011 12:01 AM, Charles Duffy wrote:

Howdy, all –

Is there a way I can make the next item in the file specificity search
path after “#{node[:platform]}-#{node[:platform_version]}” be
"#{node[:platform]}-#{node[:platform_version].split(’.’)[0]}"?

The current behavior (if I understand it from the documentation
correctly) doesn’t really make sense for a lot of cases – as minor
version numbers for RHEL-derived distributions update as time goes on
when doing regular stability-and-security updates with no action taken
by the user, cookbooks currently can break for no reason other than a
new upstream install image being available (the file you needed is
suddenly being looked for in centos-5.6/foo rather than
centos-5.5/foo, though all you really needed was to distinguish the
centos-5 version from the centos-6 version). Having a
major-version-only path entry thus makes sense; can this be
accomplished without patching Chef?

Thanks!