Closed pbrit closed 11 years ago
Am I missing something here or have you just changed "installed"" to "present" your description mentions
ensure_packages([xxxx])
@davidcollom yes, it's exactly what I did. Do you understand why I did that?
Not entirely... my understanding is that installed and present are the same?
From the docs:
Valid values are present (also called installed), absent, purged, held, latest.
There is things where present
and installed
are not the same. When you don't use ensure_package
function, they are the same.
Take a look at https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/lib/puppet/parser/functions/ensure_packages.rb
I guess the code is the best explanation, so see bellow.
This snippet causes compilation error (due to double definition of resource Package['libxml2']).
node foo {
package { 'libxml2':
ensure => installed
}
ensure_packages(['libxml2'])
}
But this one works well.
node foo {
package { 'libxml2':
ensure => present
}
ensure_packages(['libxml2'])
}
Is my explanation clear for you now?
Logically, code is the same as before.
But compatibility with puppet-stdlib ensure_packages/ensure_resource is on board.
Small snippet to explain commit: