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 # unattended-upgrades konfigurieren
class ubuntu_server::unattended_upgrades{ class ubuntu_server::unattended_upgrades($automatic_reboot = "false", $autoremove = "true"){
##
## 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')
File{ File{
owner => root, owner => root,
...@@ -21,16 +13,18 @@ class ubuntu_server::unattended_upgrades{ ...@@ -21,16 +13,18 @@ class ubuntu_server::unattended_upgrades{
unless => "debconf-get-selections | grep unattended | grep -q true", unless => "debconf-get-selections | grep unattended | grep -q true",
before => Package["unattended-upgrades"], before => Package["unattended-upgrades"],
} }
package{'unattended-upgrades': package{'unattended-upgrades':
ensure => present, ensure => present,
} }
file{'/etc/apt/apt.conf.d/50unattended-upgrades': file{'/etc/apt/apt.conf.d/50unattended-upgrades':
ensure => present, ensure => present,
content => template("ubuntu_server/etc/apt/apt.conf.d/${operatingsystem}_50unattended-upgrades.erb"), content => template("ubuntu_server/etc/apt/apt.conf.d/${operatingsystem}_50unattended-upgrades.erb"),
} }
file{'/etc/apt/apt.conf.d/20auto-upgrades': file{'/etc/apt/apt.conf.d/20auto-upgrades':
ensure => present, ensure => present,
source => "puppet:///modules/ubuntu_server/etc/apt.conf.d/20auto-upgrades", source => "puppet:///modules/ubuntu_server/etc/apt.conf.d/20auto-upgrades",
} }
} }
...@@ -49,7 +49,7 @@ Unattended-Upgrade::Mail "root@localhost"; ...@@ -49,7 +49,7 @@ Unattended-Upgrade::Mail "root@localhost";
// Do automatic removal of new unused dependencies after the upgrade // Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove) // (equivalent to apt-get autoremove)
<% if unattended_upgrade_autoremove == "true" -%> <% if autoremove == "true" -%>
Unattended-Upgrade::Remove-Unused-Dependencies "true"; Unattended-Upgrade::Remove-Unused-Dependencies "true";
<% else -%> <% else -%>
//Unattended-Upgrade::Remove-Unused-Dependencies "false"; //Unattended-Upgrade::Remove-Unused-Dependencies "false";
...@@ -57,7 +57,7 @@ Unattended-Upgrade::Remove-Unused-Dependencies "true"; ...@@ -57,7 +57,7 @@ Unattended-Upgrade::Remove-Unused-Dependencies "true";
// Automatically reboot *WITHOUT CONFIRMATION* // Automatically reboot *WITHOUT CONFIRMATION*
// if the file /var/run/reboot-required is found after the upgrade // 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"; Unattended-Upgrade::Automatic-Reboot "true";
<% else -%> <% else -%>
//Unattended-Upgrade::Automatic-Reboot "false"; //Unattended-Upgrade::Automatic-Reboot "false";
...@@ -66,7 +66,7 @@ Unattended-Upgrade::Automatic-Reboot "true"; ...@@ -66,7 +66,7 @@ Unattended-Upgrade::Automatic-Reboot "true";
// If automatic reboot is enabled and needed, reboot at the specific // If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately // time instead of immediately
// Default: "now" // Default: "now"
<% if unattended_upgrade_automatic_reboot == "true" -%> <% if automatic_reboot == "true" -%>
Unattended-Upgrade::Automatic-Reboot-Time "02:00"; Unattended-Upgrade::Automatic-Reboot-Time "02:00";
<% else -%> <% else -%>
//Unattended-Upgrade::Automatic-Reboot-Time "02:00"; //Unattended-Upgrade::Automatic-Reboot-Time "02:00";
......
...@@ -47,7 +47,7 @@ Unattended-Upgrade::Mail "root@localhost"; ...@@ -47,7 +47,7 @@ Unattended-Upgrade::Mail "root@localhost";
// Do automatic removal of new unused dependencies after the upgrade // Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove) // (equivalent to apt-get autoremove)
<% if unattended_upgrade_autoremove == "true" -%> <% if autoremove == "true" -%>
Unattended-Upgrade::Remove-Unused-Dependencies "true"; Unattended-Upgrade::Remove-Unused-Dependencies "true";
<% else -%> <% else -%>
//Unattended-Upgrade::Remove-Unused-Dependencies "false"; //Unattended-Upgrade::Remove-Unused-Dependencies "false";
...@@ -55,7 +55,7 @@ Unattended-Upgrade::Remove-Unused-Dependencies "true"; ...@@ -55,7 +55,7 @@ Unattended-Upgrade::Remove-Unused-Dependencies "true";
// Automatically reboot *WITHOUT CONFIRMATION* // Automatically reboot *WITHOUT CONFIRMATION*
// if the file /var/run/reboot-required is found after the upgrade // 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"; Unattended-Upgrade::Automatic-Reboot "true";
<% else -%> <% else -%>
//Unattended-Upgrade::Automatic-Reboot "false"; //Unattended-Upgrade::Automatic-Reboot "false";
...@@ -64,7 +64,7 @@ Unattended-Upgrade::Automatic-Reboot "true"; ...@@ -64,7 +64,7 @@ Unattended-Upgrade::Automatic-Reboot "true";
// If automatic reboot is enabled and needed, reboot at the specific // If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately // time instead of immediately
// Default: "now" // Default: "now"
<% if unattended_upgrade_automatic_reboot == "true" -%> <% if automatic_reboot == "true" -%>
Unattended-Upgrade::Automatic-Reboot-Time "02:00"; Unattended-Upgrade::Automatic-Reboot-Time "02:00";
<% else -%> <% else -%>
//Unattended-Upgrade::Automatic-Reboot-Time "02:00"; //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