Daniel
Daniel

Reputation: 10235

Specify PHP version with PuppetLabs' Apache module

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?

Upvotes: 0

Views: 910

Answers (1)

Ger Apeldoorn
Ger Apeldoorn

Reputation: 1232

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

Upvotes: 1

Related Questions