aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README69
-rw-r--r--manifests/cron/dist_upgrade.pp17
-rw-r--r--manifests/cron/download.pp19
-rw-r--r--manifests/init.pp9
-rw-r--r--manifests/preferences.pp20
-rw-r--r--manifests/preferences/absent.pp1
-rw-r--r--manifests/preferences_snippet.pp12
7 files changed, 76 insertions, 71 deletions
diff --git a/README b/README
index 1d43284..b625ff9 100644
--- a/README
+++ b/README
@@ -18,8 +18,6 @@ Ubuntu support is lagging behind but not absent either.
This module needs:
- the lsb module: git://labs.riseup.net/shared-lsb
-- the common module: git://labs.riseup.net/shared-common
-- the concat module: git://labs.riseup.net/shared-concat
By default, on normal hosts, this module sets the configuration option
DSelect::Clean to 'auto'. On virtual servers, the value is set by default to
@@ -180,17 +178,17 @@ apt::apticron
When you include this class, apticron will be installed, with the following
defaults, which you are free to change before you include the class:
- $apticron_ensure_version = "present"
- $apticron_email = "root"
+ $apticron_ensure_version = 'present'
+ $apticron_email = 'root'
$apticron_config = "apt/${operatingsystem}/apticron_${lsbrelease}.erb"
- $apticron_diff_only = "1"
- $apticron_listchanges_profile = "apticron"
+ $apticron_diff_only = 1
+ $apticron_listchanges_profile = 'apticron'
$apticron_system = false
$apticron_ipaddressnum = false
$apticron_ipaddresses = false
- $apticron_notifyholds = "0"
- $apticron_notifynew = "0"
- $apticron_customsubject = ""
+ $apticron_notifyholds = 0
+ $apticron_notifynew = 0
+ $apticron_customsubject = ''
apt::cron::download
-------------------
@@ -203,7 +201,7 @@ $apt_cron_hours variable before you include the class: its value will
be passed as the "hours" parameter of a cronjob. Example:
# Run cron-apt every three hours
- $apt_cron_hours = "*/3"
+ $apt_cron_hours = '*/3'
Note that the default 4 AM cronjob won't be disabled.
@@ -239,9 +237,9 @@ file's content changes. The initiator file is copied from the first
available source amongst the following ones, in decreasing priority
order:
-- puppet:///site_apt/${fqdn}/upgrade_initiator
-- puppet:///site_apt/upgrade_initiator
-- puppet:///apt/upgrade_initiator
+- puppet:///modules/site_apt/${fqdn}/upgrade_initiator
+- puppet:///modules/site_apt/upgrade_initiator
+- puppet:///modules/apt/upgrade_initiator
This is useful when one does not want to setup a fully automated
upgrade process but still needs a way to manually trigger full
@@ -266,13 +264,13 @@ apt::listchanges
This class, when included, installs apt-listchanges and configures it using the
following variables, the defaults are below:
- $apt_listchanges_version = "present"
+ $apt_listchanges_version = 'present'
$apt_listchanges_config = "apt/${operatingsystem}/listchanges_${lsbrelease}.erb"
- $apt_listchanges_frontend = "pager"
- $apt_listchanges_email = "root"
- $apt_listchanges_confirm = "0"
- $apt_listchanges_saveseen = "/var/lib/apt/listchanges.db"
- $apt_listchanges_which = "both"
+ $apt_listchanges_frontend = 'pager'
+ $apt_listchanges_email = 'root'
+ $apt_listchanges_confirm = 0
+ $apt_listchanges_saveseen = '/var/lib/apt/listchanges.db'
+ $apt_listchanges_which = 'both'
apt::proxy_client
-----------------
@@ -306,36 +304,47 @@ meta-parameter to define content inline or with the help of a template.
Example:
- apt::apt_conf { "80download-only":
- source => "puppet:///modules/site_apt/80download-only",
+ apt::apt_conf { '80download-only':
+ source => 'puppet:///modules/site_apt/80download-only',
}
apt::preferences_snippet
------------------------
-A way to add pinning information to /etc/apt/preferences
+A way to add pinning information to files in /etc/apt/preferences.d/
Example:
- apt::preferences_snippet{
+ apt::preferences_snippet {
'irssi-plugin-otr':
release => 'lenny-backports',
priority => 999;
}
- apt::preferences_snippet{
+ apt::preferences_snippet {
'unstable_fallback':
package => '*',
release => 'unstable',
priority => 1;
}
- apt::preferences_snippet{
+ apt::preferences_snippet {
'ttdnsd':
pin => 'origin deb.torproject.org',
priority => 999;
}
+The names of the resources will be used as the names of the files in the
+preferences.d directory, so you should ensure that resource names follow the
+prescribed naming scheme.
+
+From apt_preferences(5):
+ Note that the files in the /etc/apt/preferences.d directory are parsed in
+ alphanumeric ascending order and need to obey the following naming
+ convention: The files have no or "pref" as filename extension and which
+ only contain alphanumeric, hyphen (-), underscore (_) and period (.)
+ characters - otherwise they will be silently ignored.
+
apt::preseeded_package
----------------------
@@ -350,8 +359,8 @@ following in your manifest:
You can also specify the content of the seed via the content parameter,
for example:
- apt::preseeded_package { "apticron":
- content => "apticron apticron/notification string root@example.com",
+ apt::preseeded_package { 'apticron':
+ content => 'apticron apticron/notification string root@example.com',
}
apt::sources_list
@@ -392,12 +401,12 @@ upgrade_package { "perl":
Resources
=========
-Concat[apt_config]
+File['apt_config']
------------------
Use this resource to depend on or add to a completed apt configuration
-Exec[apt_updated]
+Exec['apt_updated']
-----------------
After this point the APT indexes are up-to-date.
@@ -406,7 +415,7 @@ This resource is usually used like this to ensure current packages are
installed by Package resources:
include apt::update
- Package { require => Exec[apt_updated] }
+ Package { require => Exec['apt_updated'] }
Please note that the apt::upgrade_package define automatically uses
this resource so you don't have to manage this yourself if you need to
diff --git a/manifests/cron/dist_upgrade.pp b/manifests/cron/dist_upgrade.pp
index 1c8adb1..bd29784 100644
--- a/manifests/cron/dist_upgrade.pp
+++ b/manifests/cron/dist_upgrade.pp
@@ -10,14 +10,15 @@ dist-upgrade -y -o APT::Get::Show-Upgraded=true -o 'DPkg::Options::=--force-conf
package { "apt-listbugs": ensure => absent }
- config_file { "/etc/cron-apt/action.d/4-dist-upgrade":
- content => $action,
- require => Package[cron-apt]
- }
-
- config_file { "/etc/cron-apt/config.d/MAILON":
- content => "MAILON=upgrade\n",
- require => Package[cron-apt]
+ file {
+ "/etc/cron-apt/action.d/4-dist-upgrade":
+ content => $action,
+ mode => 0644, owner => root, group => 0,
+ require => Package[cron-apt];
+ "/etc/cron-apt/config.d/MAILON":
+ content => "MAILON=upgrade\n",
+ mode => 0644, owner => root, group => 0,
+ require => Package[cron-apt];
}
}
diff --git a/manifests/cron/download.pp b/manifests/cron/download.pp
index a27967d..5c2d3f9 100644
--- a/manifests/cron/download.pp
+++ b/manifests/cron/download.pp
@@ -3,19 +3,20 @@ class apt::cron::download inherits apt::cron::base {
$action = "autoclean -y
dist-upgrade -d -y -o APT::Get::Show-Upgraded=true
"
-
+
file { "/etc/cron-apt/action.d/4-dist-upgrade":
ensure => absent,
}
- config_file { "/etc/cron-apt/action.d/3-download":
- content => $action,
- require => Package[cron-apt]
- }
-
- config_file { "/etc/cron-apt/config.d/MAILON":
- content => "MAILON=changes\n",
- require => Package[cron-apt]
+ file {
+ "/etc/cron-apt/action.d/3-download":
+ content => $action,
+ mode => 0644, owner => root, group => 0,
+ require => Package[cron-apt];
+ "/etc/cron-apt/config.d/MAILON":
+ content => "MAILON=changes\n",
+ mode => 0644, owner => root, group => 0,
+ require => Package[cron-apt];
}
}
diff --git a/manifests/init.pp b/manifests/init.pp
index 3280a3a..3df48c3 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -85,7 +85,7 @@ class apt {
$next_codename = debian_nextcodename($codename)
$next_release = debian_nextrelease($release)
- config_file {
+ file {
# include main, security and backports
# additional sources should be included via the apt::sources_list define
"/etc/apt/sources.list":
@@ -93,6 +93,7 @@ class apt {
'' => template( "apt/$operatingsystem/sources.list.erb"),
default => $custom_sources_list
},
+ mode => 0644, owner => root, group => 0,
require => Package['lsb'],
notify => Exec['refresh_apt'],
}
@@ -145,10 +146,6 @@ class apt {
# backports uses the normal archive key now
package { "debian-backports-keyring": ensure => absent }
- include common::moduledir
- $apt_base_dir = "${common::moduledir::module_dir_path}/apt"
- modules_dir { apt: }
-
if $custom_key_dir {
file { "${apt_base_dir}/keys.d":
source => "$custom_key_dir",
@@ -162,7 +159,7 @@ class apt {
}
if $custom_preferences != false {
Exec["custom_keys"] {
- before => Concat[apt_config],
+ before => File['apt_config'],
}
}
}
diff --git a/manifests/preferences.pp b/manifests/preferences.pp
index f188149..f766819 100644
--- a/manifests/preferences.pp
+++ b/manifests/preferences.pp
@@ -1,20 +1,18 @@
class apt::preferences {
- concat::fragment{"apt_preferences_header":
- content => $custom_preferences ? {
- '' => $operatingsystem ? {
- 'debian' => template("apt/${operatingsystem}/preferences_${codename}.erb"),
- 'ubuntu' => template("apt/${operatingsystem}/preferences_${codename}.erb"),
- },
- default => $custom_preferences
+ $pref_contents = $custom_preferences ? {
+ '' => $operatingsystem ? {
+ 'debian' => template("apt/${operatingsystem}/preferences_${codename}.erb"),
+ 'ubuntu' => template("apt/${operatingsystem}/preferences_${codename}.erb"),
},
- order => 00,
- target => '/etc/apt/preferences',
+ default => $custom_preferences
}
- concat{'/etc/apt/preferences':
- alias => apt_config,
+ file { '/etc/apt/preferences':
+ ensure => present,
+ alias => 'apt_config',
# only update together
+ content => $pref_contents,
require => File["/etc/apt/sources.list"],
owner => root, group => 0, mode => 0644;
}
diff --git a/manifests/preferences/absent.pp b/manifests/preferences/absent.pp
index 0e96119..68ab400 100644
--- a/manifests/preferences/absent.pp
+++ b/manifests/preferences/absent.pp
@@ -1,6 +1,7 @@
class apt::preferences::absent {
file { '/etc/apt/preferences':
+ alias => 'apt_config',
ensure => absent,
}
}
diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp
index 6a8e6bc..1aafe57 100644
--- a/manifests/preferences_snippet.pp
+++ b/manifests/preferences_snippet.pp
@@ -23,11 +23,9 @@ define apt::preferences_snippet(
fail("apt::preferences_snippet requires either a 'pin' or 'release' argument, not both")
}
- include apt::preferences
-
- concat::fragment{"apt_preference_${name}":
+ file { "/etc/apt/preferences.d/${name}":
ensure => $ensure,
- target => '/etc/apt/preferences',
+ owner => root, group => 0, mode => 0644;
}
# This should really work in the same manner as sources_list and apt_conf
@@ -37,19 +35,19 @@ define apt::preferences_snippet(
'': {
case $release {
'': {
- Concat::Fragment["apt_preference_${name}"]{
+ File["/etc/apt/preferences.d/${name}"]{
content => template("apt/preferences_snippet.erb")
}
}
default: {
- Concat::Fragment["apt_preference_${name}"]{
+ File["/etc/apt/preferences.d/${name}"]{
content => template("apt/preferences_snippet_release.erb")
}
}
}
}
default: {
- Concat::Fragment["apt_preference_${name}"]{
+ File["/etc/apt/preferences.d/${name}"]{
source => $source
}
}