Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/package version #15

Closed
wants to merge 2 commits into from
Closed

Feature/package version #15

wants to merge 2 commits into from

Conversation

haf
Copy link
Contributor

@haf haf commented Apr 3, 2013

When I try this on another puppet module:

Error: Could not update: Execution of '/bin/rpm -U --oldpackage /tmp/riemann-0.2.0-1.noarch.rpm' returned 1:    package
riemann-0.2.0-1.noarch is already installed

Error: /Stage[main]/Riemann::Package/Package[riemann]/ensure: change from 0.2.0-1 to 0.2.0 failed: Could not update: Exe
cution of '/bin/rpm -U --oldpackage /tmp/riemann-0.2.0-1.noarch.rpm' returned 1:        package riemann-0.2.0-1.noarch i
s already installed

for code:

    $package_version = $version ? {
      ''      => 'installed',
      undef   => 'installed',
      default => $version,
    }
    package { 'riemann':
      ensure   => $package_version,
      source   => "/tmp/$package_name",
      provider => $package_provider,
      require  => Wget::Fetch['download_riemann'],
    }

Is this a problem with puppet or am I doing something wrong?

@Iristyle
Copy link

BTW -- I don't know how this happened, but one of our Vagrant boxes ended up with Riak 1.3.1 instead of 1.3.0, despite 1.3.0 being specified for the version... The installation goes exclusively through this Puppet module. If I can figure out what happened, I'll let you know.

@haf
Copy link
Contributor Author

haf commented Apr 30, 2013

It's because the module only installs the package but doesn't give the version parameter to the package installer; hence it will install that latest.

If you don't want the latest it would be a good thing to freeze the version as you wanted to do (but that you wanted to do once to target the latest version), but when that is done, I get the pasted (above) error from yum; so I can't let the package resource get the $version parameter until I can understand why giving it produces the errors.

@haf
Copy link
Contributor Author

haf commented Jul 27, 2013

The reason it gives errors is because of suffix on the semver that are needed for yum, such as "_1.el6", so that the version becomes "1.2.3_1.el6" or similar. That's next up to fix.

@haf
Copy link
Contributor Author

haf commented Nov 27, 2013

Closing thx to @rdark.

@haf haf closed this Nov 27, 2013
@mbbroberg mbbroberg deleted the feature/package-version branch March 25, 2015 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants