puppet-php icon indicating copy to clipboard operation
puppet-php copied to clipboard

Provide ability to specify a specific version of PHP to install

Open rtgibbons opened this issue 12 years ago • 12 comments

Got the idea from - http://docs.puppetlabs.com/puppet/2.7/reference/lang_classes.html#defining-a-class

Please let me know what you think.

rtgibbons avatar Jan 17 '13 07:01 rtgibbons

Most changes seems to rename $ensure to $version. Is there any specific reason for this, as this change will break the module for all people already using it and defining ensure.

Most of the functionality you're trying to implement is already possible with the ensure parameter. I'd rather like to see this functionality fixed/improved.

saz avatar Feb 01 '13 23:02 saz

First off, I need to clean up this pull request. I started putting too much work into this one branch and forgot I had the pull request set.

Secondly, there wasn't an $ensure variable being used. The class to install the package was hardcoded to ensure => present. I wanted to be able to load the php-fpm class and pass in a version number to a specific version. I've set the default to be present, so it won't break for everyone.

So now, for install php-fpm I can call

class { 'php-fpm':
  version => '5.4.8-precise~1'
}

If there was a way to override the below code in another way I'd like to hear how.

package { 'php-fpm':
  ensure => present
} 

rtgibbons avatar Feb 01 '13 23:02 rtgibbons

Oh, I see where I change the $ensure for the php::module. I do this based on the documentation from puppetlabs, and just keeping with their practices. We could probably leave the $ensure and still have the $version, and use $version if it's not undef, and otheruse use $ensure

rtgibbons avatar Feb 01 '13 23:02 rtgibbons

According to the documentation in the link, you can set the ensure to the version of the package you want and it will install that packaged version

rtgibbons avatar Feb 01 '13 23:02 rtgibbons

What about using ensure rather then version and implementing the missing parts? I think this is the best solution, as this won't change anything for old installations and you're able to specify a specific version.

What do you mean?

saz avatar Feb 02 '13 00:02 saz

Yeah, that would work. Again I was just basing it off the precedence set by the docs at http://docs.puppetlabs.com/puppet/2.7/reference/lang_classes.html#defining-a-class

rtgibbons avatar Feb 02 '13 00:02 rtgibbons

I'll get this code cleaned up sticking with the standards you've already set

rtgibbons avatar Feb 02 '13 00:02 rtgibbons

Great. Thanks!

saz avatar Feb 02 '13 00:02 saz

Was just looking around for a solution to this. Was this resolved/is this achievable with the master?

Happy to help where I can.

Stoosh avatar Feb 28 '13 00:02 Stoosh

No, I got distracted with the rest of our roll our and forget. I need to clean up the variable usage for ensure.

rtgibbons avatar Feb 28 '13 01:02 rtgibbons

Any progress on this one? hard locking versions is a big positive once its in...

CpuID avatar Dec 11 '13 07:12 CpuID

No, our department decided not to go with Puppet and I haven't had time to go back. It still needs the variable clean up as suggested by saz

rtgibbons avatar Dec 11 '13 15:12 rtgibbons