On Tuesday, August 21, 2012 3:57:43 PM UTC-4, Ramin K wrote:
>
>
> What happens when you have two or more statements about the same
> resource in conflict?
>
> package { 'mysql': ensure => installed, }
> package { 'mysql': ensure => 5.0.92, }
> package { 'mysql': ensure => latest, }
>
Ok, I think this is my issue. To me, "installed" doesn't sound like it
should conflict with the other two at all. It sounds like "hey, I don't
care which version of mysql you have, as long as you have one. If
not...let's fix that now." But that's not what it means. If it did, then
puppet wouldn't need to flag it as a collision if I wrote this:
package { 'mysql': ensure => installed, }
package { 'mysql': ensure => installed, }
package { 'mysql': ensure => installed, }
Puppet would be able to say "check if it's installed. yep, we're checking
if it's installed. yep, we're checking if it's installed."
And, if you think about it, this wouldn't even be a problem (logically
speaking):
package { 'mysql': ensure => installed, }
package { 'mysql': ensure => 5.0.92, }
package { 'mysql': ensure => installed, }
But I just need to let that go, since puppet doesn't work that way. lol
Anyway, we've decided to go with the !Defined syntax I suggested in my
original post for now until we find a better solution, since that syntax
actual means what we mean, and doesn't require external logistics. We'll
revisit this decision after we've gotten more classes implemented and
evaluate the relative benefits of the other available solutions at the
time. This will at least allow us to move forward and get other things
working.
Therefore you need to specify it once. You can do this a few different
> ways.
>
>
[examples for virtual resources and classes deleted]
So, my basic issue with both the class method and the virtual resources
method is that they basically require me to maintain a SECOND list of every
package I want to maintain this way (either class or virtual resource
definitions). This seems like a lot of syntactic and logistical overhead,
especially when you consider that if we ignore the possibility of
collisions, we can just do this:
package { ['perl', 'mysql', 'gcc', 'screen', 'foo', 'bar', 'baz']:
ensure => installed
}
This is clean, concise, and trivial to understand. This is kind of what I
was hoping for. I understand that we'll probably have to use the class
method for any packages where ACTUAL conflicts exist (e.g., the version
example you gave above), but for virtually all of our packages, we're not
going to have that problem.
Thanks a lot for your feedback. It was good to have simple examples of all
the options in one place.
thanks,
Michael
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/s22Y28jjDlsJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.