Puppet : Specifying a version of a package to install

JulienD picture JulienD · Jul 23, 2012 · Viewed 39.6k times · Source

Apparently this is not possible, but I can't believe that I'm the only one who need it.

I want to specify the version of php to install because I'm working on an old project requiring php 5.2.

Actually my VM is based on Oneiric with php 5.3

Do you have any solution to do this ?

Answer

opsmason picture opsmason · Jul 23, 2012

You can specify a version:

package { 'php' :
  ensure => '5.2' ,
}

However, if that version of PHP RPM/Deb/package isn't available in your upstream repo, then you'll want to either:

  1. Find an alternate repo that has that package, and add it to your repo list
  2. Set up your own repo with the package
  3. Install from your filesystem, by providing a path to the package:

    package { 'php' :
      ensure => '5.2' ,
      source => '/some/path/to/php-5.2.rpm' ,
    }