Avoiding CHEF-3694

What’s the right way to avoid CHEF-3694 for the simple case of prerequiste
packages?

I’m about to build an oracle instantclient cookbook so I can fold it into
the database cookbook, but I want chrpath installed so I can fix up the
path in sqlplus.

I could do:

begin
resources(‘package[chrpath]’)
rescue Chef::Exceptions::ResourceNotFound
package 'chrpath’
end

But it feels kinda ugly… am I missing something?


Alex Kiernan

That is not what you want. You want to a package resource, for the package chrpath, with action install, and the latest version available. No extra flags to the package installer.

Just because someone else defined a package[chrpath] resource doesn't mean any of the rest of that is true. They may using the remove action.

CHEF-3694 just says: you've got multiple attempts to define a resource. The only way to guarantee that those two attempts play nice is to use a good olde fashioned eyeball, figure out what the intersecting requirements are, and only do that once.

--

On Jun 10, 2013, at 4:29, Alex Kiernan alex.kiernan@gmail.com wrote:

What's the right way to avoid CHEF-3694 for the simple case of prerequiste packages?

I'm about to build an oracle instantclient cookbook so I can fold it into the database cookbook, but I want chrpath installed so I can fix up the path in sqlplus.

I could do:

begin
resources('package[chrpath]')
rescue Chef::Exceptions::ResourceNotFound
package 'chrpath'
end

But it feels kinda ugly... am I missing something?

--
Alex Kiernan

Urgh, you've just made me realise resource cloning is even more insidious
than I'd previously realised
On 10 Jun 2013 18:14, "Joseph Holsten" joseph@josephholsten.com wrote:

That is not what you want. You want to a package resource, for the package
chrpath, with action install, and the latest version available. No extra
flags to the package installer.

Just because someone else defined a package[chrpath] resource doesn't mean
any of the rest of that is true. They may using the remove action.

CHEF-3694 just says: you've got multiple attempts to define a resource.
The only way to guarantee that those two attempts play nice is to use a
good olde fashioned eyeball, figure out what the intersecting requirements
are, and only do that once.

--
http://josephholsten.com

On Jun 10, 2013, at 4:29, Alex Kiernan alex.kiernan@gmail.com wrote:

What's the right way to avoid CHEF-3694 for the simple case of
prerequiste packages?

I'm about to build an oracle instantclient cookbook so I can fold it
into the database cookbook, but I want chrpath installed so I can fix up
the path in sqlplus.

I could do:

begin
resources('package[chrpath]')
rescue Chef::Exceptions::ResourceNotFound
package 'chrpath'
end

But it feels kinda ugly... am I missing something?

--
Alex Kiernan

Resource cloning: Die in all the fires

Alex Kiernan wrote:

Urgh, you've just made me realise resource cloning is even more
insidious than I'd previously realised

On 10 Jun 2013 18:14, "Joseph Holsten" <joseph@josephholsten.com
mailto:joseph@josephholsten.com> wrote:

That is not what you want. You want to a package resource, for the
package chrpath, with action install, and the latest version
available. No extra flags to the package installer.

Just because someone else defined a package[chrpath] resource
doesn't mean any of the rest of that is true. They may using the
remove action.

CHEF-3694 just says: you've got multiple attempts to define a
resource. The only way to guarantee that those two attempts play
nice is to use a good olde fashioned eyeball, figure out what the
intersecting requirements are, and only do that once.

--
http://josephholsten.com

On Jun 10, 2013, at 4:29, Alex Kiernan <alex.kiernan@gmail.com
<mailto:alex.kiernan@gmail.com>> wrote:

> What's the right way to avoid CHEF-3694 for the simple case of
prerequiste packages?
>
> I'm about to build an oracle instantclient cookbook so I can
fold it into the database cookbook, but I want chrpath installed
so I can fix up the path in sqlplus.
>
> I could do:
>
> begin
>   resources('package[chrpath]')
> rescue Chef::Exceptions::ResourceNotFound
>   package 'chrpath'
> end
>
> But it feels kinda ugly... am I missing something?
>
> --
> Alex Kiernan