summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeLutin <gabster@lelutin.ca>2016-06-29 19:35:11 +0000
committerLeLutin <gabster@lelutin.ca>2016-06-29 19:35:11 +0000
commit6277c3ba14d85b0c5d0d8cad3fc25dc9aa206357 (patch)
treeed4721a272fab59dd373dafef2f2c5ba54636a4d
parent05c2603e5e63a978122b0ae10b89c720ea3d3ff0 (diff)
parent13cb9fb48538fc7eed9b2f924aa4c84dd1434e3b (diff)
Merge branch 'feature/8-make_dist-upgrade_timeout_configurable' into 'master'
apt::dist_upgrade: add a timeout parameter (#8). See merge request !45
-rw-r--r--README.md5
-rw-r--r--manifests/dist_upgrade.pp5
2 files changed, 9 insertions, 1 deletions
diff --git a/README.md b/README.md
index 2028e2a..2f837f1 100644
--- a/README.md
+++ b/README.md
@@ -348,6 +348,11 @@ classes may inherit from this one and add to its subscription list
using the plusignment (`+>`) operator. A real-world example can be
seen in the `apt::dist_upgrade::initiator` source.
+Parameters:
+
+ * timeout: specified in seconds; the maximum time the `dist-upgrade`
+ command should take. If the command takes longer than the timeout,
+ the command is considered to have failed and will be stopped.
## apt::dist_upgrade::initiator<a name="apt-dist_upgrade-initiator"></a>
diff --git a/manifests/dist_upgrade.pp b/manifests/dist_upgrade.pp
index 19c031e..3061fb8 100644
--- a/manifests/dist_upgrade.pp
+++ b/manifests/dist_upgrade.pp
@@ -1,8 +1,11 @@
-class apt::dist_upgrade {
+class apt::dist_upgrade (
+ $timeout = 300,
+) {
exec { 'apt_dist-upgrade':
command => '/usr/bin/apt-get -q -y -o \'DPkg::Options::=--force-confold\' dist-upgrade',
refreshonly => true,
+ timeout => $timeout,
before => Exec['apt_updated']
}