aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/dist_upgrade.pp2
-rw-r--r--manifests/init.pp5
-rw-r--r--manifests/upgrade_package.pp13
3 files changed, 14 insertions, 6 deletions
diff --git a/manifests/dist_upgrade.pp b/manifests/dist_upgrade.pp
index 9e26769..347ccc7 100644
--- a/manifests/dist_upgrade.pp
+++ b/manifests/dist_upgrade.pp
@@ -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",
diff --git a/manifests/init.pp b/manifests/init.pp
index 2ae691f..794347f 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -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 ? {
diff --git a/manifests/upgrade_package.pp b/manifests/upgrade_package.pp
index 9202624..2ce6932 100644
--- a/manifests/upgrade_package.pp
+++ b/manifests/upgrade_package.pp
@@ -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'] ],
+ }
}
}