- From: Adam Jacob <
>
- To: "
" <
>
- Subject: [chef] Re: yum_package resource problem
- Date: Thu, 29 Nov 2012 15:07:59 +0000
- Accept-language: en-US
I can't say specifically about what's happening, but I can provide some
insight into Chef. You are correct that the resources are going to be
executed in order. You don't need to have the not_if on the yum_package
resource either - that's what the package provider does internally
already, essentially.
As for /etc/munin not existing - what creates it? Is it actually part of
the post-install of the package? Is it created when the munin-node client
is started (which would explain your race?)
Either way, look at whats happening when the package itself is installed
for answers - your expectations about Chef are correct, and it's how Chef
is behaving.
Best,
Adam
On 11/29/12 2:40 AM, "jfotop"
<
>
wrote:
>
Hi to all,
>
>
I'm facing some problems with a yum_package resource. Actually, what I'm
>
trying
>
to do is install a package and then configure it. The package is
>
munin-node. My
>
recipe contains the following resources, in the following order:
>
--------
>
yum_package "munin-node" do
>
not_if "rpm -qa | grep munin-node"
>
end
>
>
template "/etc/munin/munin-node.conf" do
>
source "munin-node.conf.erb"
>
mode 0644
>
end
>
------
>
(chef-version: 10.14.4)
>
-----
>
everything worked perfectly, up until yesterday. What happened was, when
>
running chef-client, the template resource through an exception and
>
exited. The
>
reason was that the parent directory "/etc/munin/", which is created
>
when the
>
packaged is installed, was not found. When running "ls /etc/munin", the
>
directory existed. And the next time chef-client ran, everything worked
>
fine.
>
So, my questions are:
>
- Does the yum_package resource run in the background?
>
- When having 2 resources in a recipe, when does the second resource start
>
executing? I had the impression that it would start execution right
>
after, and
>
only if, the previous resource completes successfully. What I seem to be
>
getting here is the template resource starts executing before the
>
yum_package
>
resource has finished what it is doing.
>
>
BTW: I tried using "retries" and "retry_delay" and it did work, but I
>
would
>
like to understand how things work.
>
>
Thanks!!
>
Archive powered by MHonArc 2.6.16.