Gitlab Community Edition Instance

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

manifests/unattended_upgrades.pp: Unattended-Upgrade::Automatic-Reboot-Time konfigurierbar

parent 6734c3ff
No related branches found
No related tags found
No related merge requests found
# unattended-upgrades konfigurieren
class ubuntu_server::unattended_upgrades($automatic_reboot = false, $autoremove = true, $allowed_origins = ["\${distro_id}:\${distro_codename}-updates","LP-PPA-ubuntu-lxc-lxd-stable:\${distro_codename}","Docker:ubuntu-\${distro_codename}","Puppetlabs:\${distro_codename}"], $package_blacklist = ['docker-engine']){
class ubuntu_server::unattended_upgrades($automatic_reboot = false, $automatic_reboot_time = '02:00', $autoremove = true, $allowed_origins = ["\${distro_id}:\${distro_codename}-updates","LP-PPA-ubuntu-lxc-lxd-stable:\${distro_codename}","Docker:ubuntu-\${distro_codename}","Puppetlabs:\${distro_codename}"], $package_blacklist = ['docker-engine']){
File{
owner => root,
......
......@@ -13,16 +13,18 @@ describe "ubuntu_server::unattended_upgrades" do
it { is_expected.to contain_file('/etc/apt/apt.conf.d/50unattended-upgrades').with_content(/^[[:blank:]]*"docker-engine";/) }
end
context "with $automatic_reboot = true, operatingsystem => Ubuntu" do
context "with $automatic_reboot = true, $automatic_reboot_time = '03:00', operatingsystem => Ubuntu" do
let(:facts) {{
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:operatingsystem => "Ubuntu"
}}
let(:params) {{
:automatic_reboot => true,
:automatic_reboot_time => '03:00',
}}
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_file('/etc/apt/apt.conf.d/50unattended-upgrades').with_content(/^Unattended-Upgrade::Automatic-Reboot[[:blank:]]*"true"/) }
it { is_expected.to contain_file('/etc/apt/apt.conf.d/50unattended-upgrades').with_content(/^Unattended-Upgrade::Automatic-Reboot-Time[[:blank:]]*"03:00"/) }
end
context "with autoremove = false, operatingsystem => Ubuntu" do
......
......@@ -67,7 +67,7 @@ Unattended-Upgrade::Automatic-Reboot "true";
// time instead of immediately
// Default: "now"
<% if @automatic_reboot == "true" -%>
Unattended-Upgrade::Automatic-Reboot-Time "02:00";
Unattended-Upgrade::Automatic-Reboot-Time "<%= @automatic_reboot_time %>";
<% else -%>
//Unattended-Upgrade::Automatic-Reboot-Time "02:00";
<% end -%>
......
......@@ -67,7 +67,7 @@ Unattended-Upgrade::Automatic-Reboot "true";
// time instead of immediately
// Default: "now"
<% if @automatic_reboot == true -%>
Unattended-Upgrade::Automatic-Reboot-Time "02:00";
Unattended-Upgrade::Automatic-Reboot-Time "<%= @automatic_reboot_time %>";
<% else -%>
//Unattended-Upgrade::Automatic-Reboot-Time "02:00";
<% end -%>
......
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