0

I'm using puppetlabs-apache to maintain my Apache installation. I want to specify the PHP version I'm using:

package { "php":
    ensure => "5.4.16"
}

But I get an error:

Duplicate declaration: Package[php] is already declared in file /path/to/my/server.pp ...

I can't find any documentation about how to specify the PHP version. It seems that the package is declared in params.pp, but it doesn't seem to allow you to change the version. So, short of hacking the module myself, how can I configure it to let me specify my own PHP package?

Daniel
  • 10,115
  • 3
  • 44
  • 62

1 Answers1

1

You could use a collector, but it is a bit hacky... :)

You can use this anywhere in your code. (even other modules)

Package <| title=='php' |> {
  ensure => "5.4.16"
}

I haven't actually tried this, but it 'should' work...

http://docs.puppetlabs.com/puppet/2.7/reference/lang_collectors.html

Ger Apeldoorn
  • 1,232
  • 8
  • 13
  • Cool! "A bit hacky" is better than what I'm using right now (which is _utterly_ hacky). I'd never seen a collector, but often wanted something like that. I'll give it a go, and accept your answer if it works. – Daniel Jul 13 '13 at 08:00