Gitlab Community Edition Instance

Skip to content
Snippets Groups Projects
Commit d3497a46 authored by Benedikt Wegmann's avatar Benedikt Wegmann
Browse files

unattended-upgrade: Parametrisierte Klasse

parent 1be4d4cf
No related branches found
No related tags found
No related merge requests found
# unattended-upgrades konfigurieren
class ubuntu_server::unattended_upgrades{
##
## TODO
## Paket ist noch nicht vollständig aktiv.
## es fehlt noch ein dpkg-reconfigure für puppet
##
$unattended_upgrade_automatic_reboot = hiera('unattended_upgrade_automatic_reboot')
$unattended_upgrade_autoremove = hiera('unattended_upgrade_autoremove')
class ubuntu_server::unattended_upgrades($automatic_reboot = "false", $autoremove = "true"){
File{
owner => root,
......@@ -21,16 +13,18 @@ class ubuntu_server::unattended_upgrades{
unless => "debconf-get-selections | grep unattended | grep -q true",
before => Package["unattended-upgrades"],
}
package{'unattended-upgrades':
ensure => present,
}
file{'/etc/apt/apt.conf.d/50unattended-upgrades':
ensure => present,
content => template("ubuntu_server/etc/apt/apt.conf.d/${operatingsystem}_50unattended-upgrades.erb"),
}
file{'/etc/apt/apt.conf.d/20auto-upgrades':
ensure => present,
source => "puppet:///modules/ubuntu_server/etc/apt.conf.d/20auto-upgrades",
ensure => present,
source => "puppet:///modules/ubuntu_server/etc/apt.conf.d/20auto-upgrades",
}
}
......@@ -49,7 +49,7 @@ Unattended-Upgrade::Mail "root@localhost";
// Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove)
<% if unattended_upgrade_autoremove == "true" -%>
<% if autoremove == "true" -%>
Unattended-Upgrade::Remove-Unused-Dependencies "true";
<% else -%>
//Unattended-Upgrade::Remove-Unused-Dependencies "false";
......@@ -57,7 +57,7 @@ Unattended-Upgrade::Remove-Unused-Dependencies "true";
// Automatically reboot *WITHOUT CONFIRMATION*
// if the file /var/run/reboot-required is found after the upgrade
<% if unattended_upgrade_automatic_reboot == "true" -%>
<% if automatic_reboot == "true" -%>
Unattended-Upgrade::Automatic-Reboot "true";
<% else -%>
//Unattended-Upgrade::Automatic-Reboot "false";
......@@ -66,7 +66,7 @@ Unattended-Upgrade::Automatic-Reboot "true";
// If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately
// Default: "now"
<% if unattended_upgrade_automatic_reboot == "true" -%>
<% if automatic_reboot == "true" -%>
Unattended-Upgrade::Automatic-Reboot-Time "02:00";
<% else -%>
//Unattended-Upgrade::Automatic-Reboot-Time "02:00";
......
......@@ -47,7 +47,7 @@ Unattended-Upgrade::Mail "root@localhost";
// Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove)
<% if unattended_upgrade_autoremove == "true" -%>
<% if autoremove == "true" -%>
Unattended-Upgrade::Remove-Unused-Dependencies "true";
<% else -%>
//Unattended-Upgrade::Remove-Unused-Dependencies "false";
......@@ -55,7 +55,7 @@ Unattended-Upgrade::Remove-Unused-Dependencies "true";
// Automatically reboot *WITHOUT CONFIRMATION*
// if the file /var/run/reboot-required is found after the upgrade
<% if unattended_upgrade_automatic_reboot == "true" -%>
<% if automatic_reboot == "true" -%>
Unattended-Upgrade::Automatic-Reboot "true";
<% else -%>
//Unattended-Upgrade::Automatic-Reboot "false";
......@@ -64,7 +64,7 @@ Unattended-Upgrade::Automatic-Reboot "true";
// If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately
// Default: "now"
<% if unattended_upgrade_automatic_reboot == "true" -%>
<% if automatic_reboot == "true" -%>
Unattended-Upgrade::Automatic-Reboot-Time "02:00";
<% else -%>
//Unattended-Upgrade::Automatic-Reboot-Time "02:00";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment