Hi everyone
I've got a little bit of an issue which I'm currently fighting with. At the
moment, we pass an array of packages to be installed to the package
resource, however I need to call an apt-get update prior to the package
installation (in case we add a new repo etc). My snippet below should
probably give you a good idea of what I want to achieve:
$installpackages = hiera_array('installed-packages')
exec { "apt-update":
command => "/usr/bin/apt-get update",
refreshonly => true,
}
package { $installpackages:
ensure => 'present',
require => Exec['apt-update'],
}
Obviously my goal is to have the update only run if any packages are
actually going to be installed - I can't use empty() against the array as
it will always contain content.
Can anyone suggest how I can achieve this?
Thanks!
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/8c248cca-5174-4406-a145-0634bfcfce9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.