Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Conversation

rtgibbons
Copy link

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.

@saz
Copy link
Owner

saz commented Feb 1, 2013

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.

@rtgibbons
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@saz
Copy link
Owner

saz commented Feb 2, 2013

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?

@rtgibbons
Copy link
Author

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
Copy link
Author

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

@saz
Copy link
Owner

saz commented Feb 2, 2013

Great. Thanks!

@Stoosh
Copy link

Stoosh commented Feb 28, 2013

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

Happy to help where I can.

@rtgibbons
Copy link
Author

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

@CpuID
Copy link

CpuID commented Dec 11, 2013

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

@rtgibbons
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants