[chef] RE: Re: yum_package resource problem


Chronological Thread 
  • From: Kevin Keane (subscriptions) < >
  • To: < >
  • Subject: [chef] RE: Re: yum_package resource problem
  • Date: Thu, 29 Nov 2012 13:10:15 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=sendgrid.info; h=subject :from:to:mime-version:content-type:in-reply-to:references :sender; q=dns; s=smtpapi; b=xlyDcBI9MH7s0Womj93px/r6gnMfN/afQbO 6xUxLPLz8AouXttPJqLtaF+oDohtw9yPRD54FazRPaJy2ba5zEjRn1ND8s/f3Hv5 ydKSfj0Wzs08XlXQC/VSRLh3F8EqGpnN/lmTGJwSdnEfs5OXtgt6XFBFze3kHNBi xkXlcSTA=

Title: RE: [chef] Re: yum_package resource problem

Maybe SELinux denies access to the process that runs chef. You can test that by setting SELinux to permissive mode, and then test it again. Permissive mode will flag SELinux denials, but allow the process to access the file anyway.

 

Unfortunately, chef destroys SELinux contexts for templated files; you can fix that with restorecon -r /etc/munin . I put that into all my recipes (of course, you can also turn off SELinux, but that's no longer a realistic option in today's environment).
 

Try running ls -lahZ /etc/munin

 

-----Original message-----
From: Adam Jacob < >
Sent: Thu 11-29-2012 07:08 am
Subject: [chef] Re: yum_package resource problem
To: ;
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.

§