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 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'] }