Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Commit

Permalink
Merge pull request #5 from bitte-ein-bit/master
Browse files Browse the repository at this point in the history
Option to overwrite template
  • Loading branch information
andyleejordan committed Dec 7, 2015
2 parents de14f79 + f334daf commit 37fd7a2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,19 @@ The simplest use of this module is:
This module has one class, `unattended_upgrades`, with the following
parameters:

$period = 1, # Update period (in days)
$repos = {}, # Repos to upgrade - defaults to empty.
$blacklist = [], # Packages to not update
$email = '', # Email for update status
$autofix = true, # Ensure updates keep getting installed
$minimal_steps = true, # Allows for shutdown during an upgrade
$on_shutdown = false, # Install only on shutdown
$on_error = false, # Email only on errors, else always
$autoremove = false, # Automatically remove unused dependencies
$auto_reboot = false, # Automatically reboot if needed
$period = 1, # Update period (in days)
$repos = {}, # Repos to upgrade
$blacklist = [], # Packages to not update
$email = '', # Email for update status
$autofix = true, # Ensure updates keep getting ins
$minimal_steps = true, # Allows for shutdown during an u
$on_shutdown = false, # Install only on shutdown
$on_error = false, # Email only on errors, else alwa
$autoremove = false, # Automatically remove unused dep
$auto_reboot = false, # Automatically reboot if needed
$template_unattended_upgrades = 'unattended_upgrades/unattended-upgrades.erb', # Path to config template
$template_auto_upgrades = 'unattended_upgrades/auto-upgrades.erb', # Path to apt config template


Logs are at the usual `/var/log/unattended-upgrades`, and emails will
be automatically sent if an email is given.
Expand Down
28 changes: 15 additions & 13 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
class unattended_upgrades(
$period = 1, # Update period (in days)
$repos = {}, # Repos to upgrade
$blacklist = [], # Packages to not update
$email = '', # Email for update status
$autofix = true, # Ensure updates keep getting installed
$minimal_steps = true, # Allows for shutdown during an upgrade
$on_shutdown = false, # Install only on shutdown
$on_error = false, # Email only on errors, else always
$autoremove = false, # Automatically remove unused dependencies
$auto_reboot = false, # Automatically reboot if needed
$period = 1, # Update period (in days)
$repos = {}, # Repos to upgrade
$blacklist = [], # Packages to not update
$email = '', # Email for update status
$autofix = true, # Ensure updates keep getting installed
$minimal_steps = true, # Allows for shutdown during an upgrade
$on_shutdown = false, # Install only on shutdown
$on_error = false, # Email only on errors, else always
$autoremove = false, # Automatically remove unused dependencies
$auto_reboot = false, # Automatically reboot if needed
$template_unattended_upgrades = 'unattended_upgrades/unattended-upgrades.erb', # Path to config template
$template_auto_upgrades = 'unattended_upgrades/auto-upgrades.erb', # Path to apt config template
) {

$conf_path = '/etc/apt/apt.conf.d/50unattended-upgrades'
Expand All @@ -22,21 +24,21 @@
package { $package:
ensure => latest,
}

file { $conf_path:
ensure => file,
owner => root,
group => root,
mode => '0644',
content => template('unattended_upgrades/unattended-upgrades.erb'),
content => template($template_unattended_upgrades),
}

file { $apt_path:
ensure => file,
owner => root,
group => root,
mode => '0644',
content => template('unattended_upgrades/auto-upgrades.erb')
content => template($template_auto_upgrades)
}

service { $package:
Expand Down

0 comments on commit 37fd7a2

Please sign in to comment.