added $apt_disable_update to disable "apt-get update" during puppetruns
This commit is contained in:
parent
4f433dbd52
commit
4204847fdd
3 changed files with 14 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
class apt::dist_upgrade {
|
||||
|
||||
include apt::update
|
||||
if $apt::disable_update = false { include apt::update }
|
||||
|
||||
exec { 'apt_dist-upgrade':
|
||||
command => "/usr/bin/apt-get -q -y -o 'DPkg::Options::=--force-confold' dist-upgrade",
|
||||
|
|
|
@ -40,6 +40,11 @@ class apt {
|
|||
'' => 'http://archive.ubuntu.com/ubuntu',
|
||||
default => "${apt_ubuntu_url}",
|
||||
}
|
||||
$disable_update = $apt_disable_update ? {
|
||||
'' => false,
|
||||
default => $apt_disable_update
|
||||
}
|
||||
|
||||
case $operatingsystem {
|
||||
'debian': {
|
||||
$repos = $apt_repos ? {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
define apt::upgrade_package ($version = "") {
|
||||
|
||||
include apt::update
|
||||
if $apt::disable_update == false {
|
||||
include apt::update
|
||||
}
|
||||
|
||||
$version_suffix = $version ? {
|
||||
'' => '',
|
||||
|
@ -24,10 +26,11 @@ define apt::upgrade_package ($version = "") {
|
|||
|
||||
exec { "apt-get -q -y -o 'DPkg::Options::=--force-confold' install ${name}${version_suffix}":
|
||||
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
|
||||
require => [
|
||||
Exec['apt_updated'],
|
||||
Package['apt-show-versions', 'dctrl-tools'],
|
||||
],
|
||||
require => $apt::disable_update ? {
|
||||
true => Package['apt-show-versions', 'dctrl-tools'],
|
||||
default => [ Exec['apt_updated'],
|
||||
Package['apt-show-versions', 'dctrl-tools'] ],
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue