summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Meusel <tim@bastelfreak.de>2016-11-02 13:55:48 +0100
committerGitHub <noreply@github.com>2016-11-02 13:55:48 +0100
commite091e467041fa099bd22b35a65a359456961e4d6 (patch)
tree39797feba18237a033121cf4408a97c02ae10466
parent53e8d94274948ff2b9cd4eac9dcfe9a29a6ddef5 (diff)
parentd469e7ddda4def790483e43a3750c3d1a81eb633 (diff)
Merge pull request #73 from dhoppe/readme
Add missing badges
-rw-r--r--README.md94
-rw-r--r--spec/classes/unattended_upgrades_spec.rb64
2 files changed, 103 insertions, 55 deletions
diff --git a/README.md b/README.md
index 5e95730..821f2e3 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,31 @@
-# unattended\_upgrades
-
-[![Build Status](https://travis-ci.org/voxpupuli/puppet-unattended_upgrades.svg?branch=master)](https://travis-ci.org/voxpupuli/puppet-unattended_upgrades)
-[![Puppet Forge Version](http://img.shields.io/puppetforge/v/puppet/unattended_upgrades.svg)](https://forge.puppetlabs.com/puppet/unattended_upgrades)
-[![Puppet Forge Total Downloads](https://img.shields.io/puppetforge/dt/puppet/unattended_upgrades.svg)](https://forge.puppetlabs.com/puppet/unattended_upgrades)
+# Unattended Upgrades module for Puppet
+
+[![Build Status](https://travis-ci.org/voxpupuli/puppet-unattended_upgrades.png?branch=master)](https://travis-ci.org/voxpupuli/puppet-unattended_upgrades)
+[![Code Coverage](https://coveralls.io/repos/github/voxpupuli/puppet-unattended_upgrades/badge.svg?branch=master)](https://coveralls.io/github/voxpupuli/puppet-unattended_upgrades)
+[![Puppet Forge](https://img.shields.io/puppetforge/v/puppet/unattended_upgrades.svg)](https://forge.puppetlabs.com/puppet/unattended_upgrades)
+[![Puppet Forge - downloads](https://img.shields.io/puppetforge/dt/puppet/unattended_upgrades.svg)](https://forge.puppetlabs.com/puppet/unattended_upgrades)
+[![Puppet Forge - endorsement](https://img.shields.io/puppetforge/e/puppet/unattended_upgrades.svg)](https://forge.puppetlabs.com/puppet/unattended_upgrades)
+[![Puppet Forge - scores](https://img.shields.io/puppetforge/f/puppet/unattended_upgrades.svg)](https://forge.puppetlabs.com/puppet/unattended_upgrades)
+
+#### Table of Contents
+
+1. [Overview](#overview)
+1. [Module Description - What the module does and why it is useful](#module-description)
+1. [Setup - The basics of getting started with splunk](#setup)
+ * [What splunk affects](#what-splunk-affects)
+ * [Beginning with splunk](#beginning-with-splunk)
+1. [Usage - Configuration options and additional functionality](#usage)
+1. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
+1. [Limitations - OS compatibility, etc.](#limitations)
+1. [License](#license)
## Overview
-The unattended\_upgrades module allows for the installation and configuration of automatic security (and other) updates through apt.
+The unattended\_upgrades module allows for the installation and configuration
+of automatic security (and other) updates through apt.
-This functionality used to be part of the puppetlabs-apt module but was split off into its own module.
+This functionality used to be part of the puppetlabs-apt module but was split
+off into its own module.
## Module Description
@@ -16,45 +33,55 @@ The unattended\_upgrades module automates the configuration of apt package updat
## Setup
-### What unattended\_upgrades affects:
+### What unattended\_upgrades affects
* Package/configuration for unattended\_upgrades
### Beginning with unattended\_upgrades
-All you need to do is include the apt module, `include apt`, and this module, `include unattended_upgrades` for it to work.
+All you need to do is include the apt module, `include apt`, and this module,
+`include unattended_upgrades` for it to work.
-This module relies on the [apt](https://forge.puppetlabs.com/puppetlabs/apt) module and will not work without it.
+This module relies on the [apt](https://forge.puppetlabs.com/puppetlabs/apt)
+module and will not work without it.
## Usage
-Using unattended\_upgrades simply consists of including the module and if needed altering some of the default settings.
+Using unattended\_upgrades simply consists of including the module and if needed
+altering some of the default settings.
## Reference
### Classes
-* `unattended_upgrades`: Main class, installs the necessary packages and writes the configuration.
+* `unattended_upgrades`: Main class, installs the necessary packages and writes
+ the configuration.
### Parameters
#### unattended\_upgrades
* `age` (`{}`): A hash of settings with two possible keys:
- * `min` (`2`): Minimum age of a cache package file. File younger than `min` will not be deleted.
- * `max` (`0`): Maximum allowed age of a cache package file. File older than `max` will be deleted.
+ * `min` (`2`): Minimum age of a cache package file. File younger than `min` will
+ not be deleted.
+ * `max` (`0`): Maximum allowed age of a cache package file. File older than `max`
+ will be deleted.
Any of these keys can be specified and will be merged into the defaults:
+
```puppet
class { 'unattended_upgrades':
age => { 'max' => 10 },
}
```
+
* `auto` (`{}`): A hash of settings with these possible keys:
- * `clean`(`0`): Remove packages that can no longer be downloaded from cache every X days (`0` = disabled).
+ * `clean`(`0`): Remove packages that can no longer be downloaded from cache every
+ X days (`0` = disabled).
* `fix_interrupted_dpkg`(`true`): Try to fix package installation state.
* `reboot`(`false`): Reboot system after package update installation.
- * `reboot_time`(`now`): If automatic reboot is enabled and needed, reboot at the specific time (instead of immediately).
+ * `reboot_time`(`now`): If automatic reboot is enabled and needed, reboot at the
+ specific time (instead of immediately).
* `remove`(`true`): Remove unneeded dependencies after update installation.
Any of these keys can be specified and will be merged into the defaults:
@@ -64,37 +91,53 @@ Using unattended\_upgrades simply consists of including the module and if needed
auto => { 'reboot' => true },
}
```
+
* `backup` (`{}`): A hash with two possible keys:
* `archive_internal` (`0`): Backup after n-days if archive contents changed.
* `level` (`3`): Backup level.
Any of these keys can be specified and will be merged into the defaults:
+
```puppet
class { 'unattended_upgrades':
backup => { 'level' => 5 },
}
```
+
* `blacklist`(`[]`): A list of packages to **not** automatically upgrade.
* `dl_limit`(`undef`): Use a bandwidth limit for downloading, specified in kb/sec.
* `enable` (`1`): Enable the automatic installation of updates.
-* `install_on_shutdown` (`false`): Install updates on shutdown instead of in the background.
-* `legacy_origin` (`true` for Debian (squeeze), Ubuntu (precise, trusty, utopic, vivid, wily, xenial, yakkety, and default), `false` for Debian (wheezy and default)): Use the legacy `Unattended-Upgrade::Allowed-Origins` setting or the modern `Unattended-Upgrade::Origins-Pattern`.
+* `install_on_shutdown` (`false`): Install updates on shutdown instead of in the
+ background.
+* `legacy_origin` (`true` for Debian (squeeze), Ubuntu (precise, trusty, utopic,
+ vivid, wily, xenial, yakkety, and default), `false` for Debian (wheezy and default)):
+ Use the legacy `Unattended-Upgrade::Allowed-Origins` setting or the modern `Unattended-Upgrade::Origins-Pattern`.
* `mail`: A hash to configure email behaviour with two possible keys:
* `only_on_error` (`true`): Only send mail when something went wrong
* `to` (`undef`): Email address to send email too
- If the default for `to` is kept you will not receive any mail at all. You'll likely want to set this parameter.
+ If the default for `to` is kept you will not receive any mail at all. You'll
+ likely want to set this parameter.
Any of these keys can be specified and will be merged into the defaults:
+
```puppet
class { 'unattended_upgrades':
mail => { 'to' => 'admin@domain.tld', },
}
```
-* `minimal_steps` (`true`): Split the upgrade process into sections to allow shutdown during upgrade.
+
+* `minimal_steps` (`true`): Split the upgrade process into sections to allow
+ shutdown during upgrade.
* `origins`: The repositories from which to automatically upgrade included packages.
-* `package_ensure` (`installed`): The ensure state for the 'unattended-upgrades' package.
-* `random_sleep` (`undef`): Maximum amount of time (in seconds) that the apt cron job can sleep before the execution. The exact amount of time will be random but upto the value specified. The purpose is to avoid that servers/mirrors get hammered at exactly the same time when a lot of machines are switched on, e.g. 9:00 in the morning. Note: If this is left unset, the default value in the apt cron job applies, which is 1800 seconds.
+* `package_ensure` (`installed`): The ensure state for the 'unattended-upgrades'
+ package.
+* `random_sleep` (`undef`): Maximum amount of time (in seconds) that the apt cron
+ job can sleep before the execution. The exact amount of time will be random but
+ upto the value specified. The purpose is to avoid that servers/mirrors get
+ hammered at exactly the same time when a lot of machines are switched on, e.g.
+ 9:00 in the morning. Note: If this is left unset, the default value in the apt
+ cron job applies, which is 1800 seconds.
* `size` (`0`): Maximum size of the cache in MB.
* `update` (`1`): Do "apt-get update" automatically every n-days.
* `upgrade` (`1`): Run the "unattended-upgrade" security upgrade script every n-days.
@@ -103,11 +146,13 @@ Using unattended\_upgrades simply consists of including the module and if needed
* `debdelta` (`1`): Use debdelta-upgrade to download updates if available.
Any of these keys can be specified and will be merged into the defaults:
+
```puppet
class { 'unattended_upgrades':
upgradeable_packages => { 'debdelta' => 1, },
}
```
+
* `verbose` (`0`): Send report mail to root.
* `options` (`{}`): A hash of settings with these possible keys:
* `force_confdef` (`true`) : Use the default option for new config files if one
@@ -123,6 +168,9 @@ This module should work across all versions of Debian, Ubuntu, and Linux Mint.
## License
-The original code for this module comes from Evolving Web and was licensed under the MIT license. Code added since the fork of that module into puppetlabs-apt is covered under the Apache License version 2 as is any code added since it was split off into this separate unattended\_upgrades module.
+The original code for this module comes from Evolving Web and was licensed under
+the MIT license. Code added since the fork of that module into puppetlabs-apt is
+covered under the Apache License version 2 as is any code added since it was split
+off into this separate unattended\_upgrades module.
The LICENSE contains both licenses.
diff --git a/spec/classes/unattended_upgrades_spec.rb b/spec/classes/unattended_upgrades_spec.rb
index ea88fad..747ccb1 100644
--- a/spec/classes/unattended_upgrades_spec.rb
+++ b/spec/classes/unattended_upgrades_spec.rb
@@ -19,35 +19,35 @@ describe 'unattended_upgrades' do
context 'with defaults on Debian' do
it do
- should contain_package('unattended-upgrades')
- should compile.with_all_deps
- should contain_class('unattended_upgrades::params')
- should contain_class('unattended_upgrades')
+ is_expected.to contain_package('unattended-upgrades')
+ is_expected.to compile.with_all_deps
+ is_expected.to contain_class('unattended_upgrades::params')
+ is_expected.to contain_class('unattended_upgrades')
end
it do
- should contain_apt__conf('unattended-upgrades').with(
+ is_expected.to contain_apt__conf('unattended-upgrades').with(
require: 'Package[unattended-upgrades]',
notify_update: false
)
end
it do
- should contain_apt__conf('periodic').with(
+ is_expected.to contain_apt__conf('periodic').with(
require: 'Package[unattended-upgrades]',
notify_update: false
)
end
it do
- should contain_apt__conf('options').with(
+ is_expected.to contain_apt__conf('options').with(
require: 'Package[unattended-upgrades]',
notify_update: false
)
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -77,7 +77,7 @@ describe 'unattended_upgrades' do
end
it do
- should create_file(file_periodic).with(
+ is_expected.to create_file(file_periodic).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -109,12 +109,12 @@ describe 'unattended_upgrades' do
end
it do
- should contain_apt__conf('auto-upgrades').with(
+ is_expected.to contain_apt__conf('auto-upgrades').with(
ensure: 'absent'
)
end
it do
- should create_file(file_options).with(
+ is_expected.to create_file(file_options).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -142,7 +142,7 @@ describe 'unattended_upgrades' do
}
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -167,7 +167,7 @@ describe 'unattended_upgrades' do
}
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -191,7 +191,7 @@ describe 'unattended_upgrades' do
}
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -214,7 +214,7 @@ describe 'unattended_upgrades' do
}
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -237,7 +237,7 @@ describe 'unattended_upgrades' do
}
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -260,7 +260,7 @@ describe 'unattended_upgrades' do
}
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -286,7 +286,7 @@ describe 'unattended_upgrades' do
}
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -309,7 +309,7 @@ describe 'unattended_upgrades' do
}
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -332,7 +332,7 @@ describe 'unattended_upgrades' do
}
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -355,7 +355,7 @@ describe 'unattended_upgrades' do
}
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -374,7 +374,7 @@ describe 'unattended_upgrades' do
}
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
'owner' => 'root',
'group' => 'root',
'mode' => '0644'
@@ -398,7 +398,7 @@ describe 'unattended_upgrades' do
}
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
'owner' => 'root',
'group' => 'root',
'mode' => '0644'
@@ -422,7 +422,7 @@ describe 'unattended_upgrades' do
}
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
'owner' => 'root',
'group' => 'root',
'mode' => '0644'
@@ -474,31 +474,31 @@ describe 'unattended_upgrades' do
}
}
end
- it { should contain_package('unattended-upgrades') }
+ it { is_expected.to contain_package('unattended-upgrades') }
it do
- should contain_apt__conf('unattended-upgrades').with(
+ is_expected.to contain_apt__conf('unattended-upgrades').with(
require: 'Package[unattended-upgrades]',
notify_update: true
)
end
it do
- should contain_apt__conf('periodic').with(
+ is_expected.to contain_apt__conf('periodic').with(
require: 'Package[unattended-upgrades]',
notify_update: true
)
end
it do
- should contain_apt__conf('options').with(
+ is_expected.to contain_apt__conf('options').with(
require: 'Package[unattended-upgrades]',
notify_update: true
)
end
it do
- should create_file(file_unattended).with(
+ is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -528,7 +528,7 @@ describe 'unattended_upgrades' do
end
it do
- should create_file(file_periodic).with(
+ is_expected.to create_file(file_periodic).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -562,7 +562,7 @@ describe 'unattended_upgrades' do
end
it do
- should create_file(file_options).with(
+ is_expected.to create_file(file_options).with(
owner: 'root',
group: 'root',
mode: '0644'
@@ -579,7 +579,7 @@ describe 'unattended_upgrades' do
)
end
it do
- should contain_apt__conf('auto-upgrades').with(
+ is_expected.to contain_apt__conf('auto-upgrades').with(
ensure: 'absent'
)
end