On Sep 29, 6:04 am, Arnau Bria <[email protected]> wrote:
> I'm on SL5 (something like RH5) and I have something as simple as:
>        package {"libX11-devel.x86_64": }
>        package {"libX11-devel.i386": }
>
> Cause I want both versions installed in my system.
>
> But on one node:

[... only the x86_64 package is installed]

> I'm trying o figure out what it's doing for checking package presence:
>
> # puppetd --test --server server.domain --debug > log
> # grep libX11-devel log
> debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q 
> libX11-devel.x86_64 --nosignature --nodigest --qf %{NAME} 
> %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
> debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q 
> libX11-devel.i386 --nosignature --nodigest --qf %{NAME} 
> %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
>
> I cannot execute that query:
> # /bin/rpm -q libX11-devel.x86_64 --nosignature --nodigest --qf %{NAME} 
> %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
> -bash: %{VERSION}: command not found
> -bash: EPOCH?{%{EPOCH}}:{0}: command not found
>
> but the first part of both returns 0:

Because the query format (everything after --qf) contains spaces and
shell metacharacters, you must enclose it in quotes to run the
command.  Either single quotes or double quotes will work, one pair
around the entire tail of the command.  And no, it is unlikely that
this is related to Puppet's (mis)behavior.  It may or may not be
important that the full command return 0, but the output on stdout is
what Puppet will mainly be looking at.

> So, anyone could help me to understand why puppet cannot install both
> packages?

There is a mismatch between Puppet's view of package names as a flat
name space and RPM's view of package identifiers as a 5-dimensional
space with axes (name, architecture, epoch, version, release).  Puppet
deals with this in a way that seems reasonable for the majority of
cases: it attempts to avoid installing multiple packages having the
same RPM name.  When neither of your packages is installed, however,
Puppet can't tell that the package "names" you specified are really
name.arch, so it passes both on to yum/rpm.  Yum and RPM can interpret
the names, but they don't mind installing the two packages side by
side.  On the other hand, when one or both of the packages is already
installed, Puppet can match the package names to installed packages,
and thereby decide that it doesn't need to install the packages.

To achieve what you want, you need a custom Package provider that
understands architecture codes in package names and allows side-by-
side installs.  Then you would declare your packages something like

package {"libX11-devel.i386": provider => "archyum"}

You would provide the "archyum" provider as a plug-in, automatically
downloadable from the puppetmaster.  I suspect that that provider
could be a relatively simple subclass or a slight variant of the
standard "yum" provider.


John
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to