diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/dist_upgrade.pp | 9 | ||||
-rw-r--r-- | manifests/init.pp | 10 | ||||
-rw-r--r-- | manifests/upgrade_package.pp | 13 |
3 files changed, 24 insertions, 8 deletions
diff --git a/manifests/dist_upgrade.pp b/manifests/dist_upgrade.pp index 9e26769..ed25b0b 100644 --- a/manifests/dist_upgrade.pp +++ b/manifests/dist_upgrade.pp @@ -1,11 +1,16 @@ 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", refreshonly => true, - require => Exec['apt_updated'], + require => $apt::disable_update ? { + true => undef, + default => Exec['apt_updated'], + } } } diff --git a/manifests/init.pp b/manifests/init.pp index 3caa376..3df48c3 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -21,7 +21,7 @@ class apt { } $debian_url = $apt_debian_url ? { - '' => 'http://cdn.debian.net/debian/', + '' => 'http://http.debian.net/debian/', default => "${apt_debian_url}", } $security_url = $apt_security_url ? { @@ -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 ? { @@ -68,6 +73,9 @@ class apt { $codename = $lsbdistcodename $release = $lsbdistrelease } + 'n/a': { + fail("Unknown lsbdistcodename reported by facter: '$lsbdistcodename', please fix this by setting this variable in your manifest.") + } default: { $codename = $lsbdistcodename $release = debian_release($codename) 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'] ], + } } } |