On Wednesday, July 2, 2014 9:51:10 AM UTC-5, Raul Macian wrote:
>
> I have a problem that starts to make me think that puppet is not usable to 
> install packages. I will explain:
>
>

That's a whopper of a claim.  Don't let any of the thousands of people who 
do use Puppet to install packages hear it.  :^)

 

> There is a common situation when you put some code on the %post when 
> creating rpm.
>


Not, it's really not.  I mean %post scriptlets themselves are pretty 
common, but scriptlets exiting nonzero is almost always bad form.  For 
instance, RedHat says, "Except in some really exceptional cases (if any), 
we want all scriptlets to exit with the zero exit status" (Fedora packaging 
guidelines, 
http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Syntax).  The 
Fedora guidelines go into more detail about why, but I'll summarize it as 
"scriptlets exiting nonzero messes you up".

 

> In my case I am executing some db migrations after the installation has 
> been performed. The problems rises when something goes wrong in the 
> scriptlet because the yum command will ignore the failure end exits with a 
> succesful code. To add more complexity the yum provider performs a yum -q 
> command, that means no output on your logs. So you don't know if the 
> installation has ended ok or not.
>
>

It's a Bad Thing if the installation does not end ok on account of a 
scriptlet failing.  Better would be for the scriptlet to record status 
information somewhere on the filesystem if the fact that it did not 
complete the intended work will not otherwise be evident.  If your 
scriptlet did so, then you could test the output via an Exec to feed that 
information back into Puppet.

 

> Here explains some things exposed
>
> https://bugzilla.redhat.com/show_bug.cgi?id=569930
>


The bottom line is that the issue described there is with RPM, therefore so 
is your complaint.  If RPM does not behave as you require, then don't use 
RPM packages.  This is not a Puppet issue.

For what its worth, I tend to agree that RPM ought not to exit with a 
success code if a scriptlet has failed.  On the other hand, RedHat's 
position, to which I subscribe, is that you oughtn't to be packaging 
scriptlets that ever *can* fail.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3055029f-69fa-49fc-9f0f-97364a83b0a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to