diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2018-05-31 10:32:22 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2018-05-31 10:32:22 -0300 |
commit | e9da7ebc036c35ef66f334d0d3be519c1c582fa4 (patch) | |
tree | d5413313a03d493ec1fed7c0b2857fb663e9a15e /manifests/subsystem | |
parent | 07c829ec91a7d7d09d9bb204d51c989e4de7eb9f (diff) | |
download | puppet-nodo-e9da7ebc036c35ef66f334d0d3be519c1c582fa4.tar.gz puppet-nodo-e9da7ebc036c35ef66f334d0d3be519c1c582fa4.tar.bz2 |
Support for hydra and DEBIAN_FRONTEND=noninteractive at nodo::subsystem::apt
Diffstat (limited to 'manifests/subsystem')
-rw-r--r-- | manifests/subsystem/apt.pp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/manifests/subsystem/apt.pp b/manifests/subsystem/apt.pp index 04d6626..6c904c6 100644 --- a/manifests/subsystem/apt.pp +++ b/manifests/subsystem/apt.pp @@ -1,9 +1,10 @@ class nodo::subsystem::apt( - $ensure = present, - $auto_upgrade = present, - $hour = 2, - $minute = 0, - $mirror = 'https://deb.debian.org', + $ensure = present, + $auto_upgrade = present, + $upgrade_handler = 'apt', + $hour = 2, + $minute = 0, + $mirror = 'https://deb.debian.org', ) { package { 'apt-transport-https': ensure => installed, @@ -33,9 +34,15 @@ class nodo::subsystem::apt( } # We have /var/log/dpkg.log, so we do not need to rotate /var/log/upgrade.log - $log = ">> /var/log/upgrade.log 2>&1" - $apt = '/usr/bin/apt-get' - $command = "${apt} update ${log} && ${apt} dist-upgrade -y ${log} && ${apt} autoremove -y ${log} && ${apt} clean ${log}" + $log = ">> /var/log/upgrade.log 2>&1" + $apt = '/usr/bin/apt-get' + + if $upgrade_handler == 'apt' { + $command = "${apt} update ${log} && ${apt} dist-upgrade -y ${log} && ${apt} autoremove -y ${log} && ${apt} clean ${log}" + } + elsif $upgrade_method == 'hydra' { + $command = "hydractl upgrade clean ${log}" + } exec { 'nodo-apt-auto-update': command => "${apt} update ${log}", @@ -46,7 +53,7 @@ class nodo::subsystem::apt( cron { 'nodo-apt-auto-upgrade': ensure => $auto_upgrade, command => $command, - environment => 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', + environment => [ 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'DEBIAN_FRONTEND=noninteractive' ], user => 'root', hour => $hour, minute => $minute, |