Forge Home

yum_arch

A temporary workaround module for PUP-1364.

11,935 downloads

7,264 latest version

3.8 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 3.0.0 (latest)
  • 2.0.1
  • 2.0.0
  • 1.0.0
released Jun 20th 2016
This version is compatible with:
  • Puppet Enterprise >= 3.8.0 < 2015.4.0
  • Puppet >= 3.0.0 < 5.0.0
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'petems-yum_arch', '3.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add petems-yum_arch
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install petems-yum_arch --version 3.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

petems/yum_arch — version 3.0.0 Jun 20th 2016

petems-yum_arch

Build Status

PUP-1364 now fixed in Puppet 4.5 onwards!

PUP-1364 has now been fixed. It should now be resolved in Puppet 4.5 onwards.

This module is for people using the older version of Puppet, a error has been added if you're using a Puppet version >= 4.5, as this module is a workaround.

Usage

package{ "firefox.x86_64":
  ensure => "45.2.0-1.el6.centos",
  provider => yum_arch,
}

What is this?

This is a basic workaround module for PUP-1364

It basically takes the code from the Yum provider, and adds a bit of a hacky regex to move the arch to the end of the version string.

A better solution would be to have an arch parameter for the Package type.

Example

Right now the way to declare an arch for a package version is like so:

package{ "firefox.x86_64":
  ensure   => "45.2.0-1.el6.centos",
  provider => yum_arch,
}

However, this adds the version number to the package name with the arch in the middle of the string, so you get a failure like this:

==> default: Error: Could not update: Execution of '/usr/bin/yum -d 0 -e 0 -y install firefox.x86_64-45.2.0-1.el6.centos' returned 1: Error: Nothing to do
==> default: Wrapped exception:
==> default: Execution of '/usr/bin/yum -d 0 -e 0 -y install firefox.x86_64-45.2.0-1.el6.centos' returned 1: Error: Nothing to do

So, I made a bit of a hacky change to move the arch string to the end of the package:

if wanted.scan(/(\.i686|\.x86_64)/)
  self.debug "Detected Arch argument in package! - Moving arch to end of version string"
  wanted.gsub!(/(.+)(\.i686|\.x86_64)(.+)/,'\1\3\2')
end

So you get this instead:

Debug: Package[firefox.x86_64](provider=yum_arch): Detected Arch argument in package! - Moving arch to end of version string
Debug: Executing '/bin/rpm -q firefox.x86_64 --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n'
Debug: Executing '/usr/bin/yum -d 0 -e 0 -y install firefox-45.2.0-1.el6.centos.x86_64'