af8ecf1e9f
Move this Exec to a dedicated class that is not included by default i.e. we default not to "apt-get update" on every Puppet run. We now make use of this class in the apt::upgrade_package define to make sure APT indexes are up-to-date before attempting package upgrades. One may now use the following to ensure current packages are installed by Package resources: include apt::update Package { require => Exec[apt_updated] }
12 lines
353 B
Puppet
12 lines
353 B
Puppet
class apt::update {
|
|
|
|
exec { 'update_apt':
|
|
command => '/usr/bin/apt-get update && /usr/bin/apt-get autoclean',
|
|
require => [ File['/etc/apt/apt.conf.d', '/etc/apt/preferences' ],
|
|
Config_file['/etc/apt/sources.list'] ],
|
|
loglevel => info,
|
|
# Another Semaphor for all packages to reference
|
|
alias => "apt_updated"
|
|
}
|
|
|
|
}
|