aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/apt_conf.pp (renamed from manifests/apt_conf_snippet.pp)6
-rw-r--r--manifests/custom_sources.pp7
-rw-r--r--manifests/init.pp9
-rw-r--r--manifests/proxy_client.pp (renamed from manifests/proxy-client.pp)4
-rw-r--r--manifests/sources_list.pp30
-rw-r--r--manifests/unattended_upgrades.pp2
6 files changed, 39 insertions, 19 deletions
diff --git a/manifests/apt_conf_snippet.pp b/manifests/apt_conf.pp
index c1cd884..62e4377 100644
--- a/manifests/apt_conf_snippet.pp
+++ b/manifests/apt_conf.pp
@@ -1,13 +1,13 @@
-define apt::apt_conf_snippet(
+define apt::apt_conf(
$ensure = 'present',
$source = '',
$content = undef
){
if $source == '' and $content == undef {
- fail("One of \$source or \$content must be specified for apt_conf_snippet ${name}")
+ fail("One of \$source or \$content must be specified for apt_conf ${name}")
}
if $source != '' and $content != undef {
- fail("Only one of \$source or \$content must specified for apt_conf_snippet ${name}")
+ fail("Only one of \$source or \$content must specified for apt_conf ${name}")
}
file { "/etc/apt/apt.conf.d/${name}":
diff --git a/manifests/custom_sources.pp b/manifests/custom_sources.pp
deleted file mode 100644
index c9e0b9c..0000000
--- a/manifests/custom_sources.pp
+++ /dev/null
@@ -1,7 +0,0 @@
-define apt::custom_sources_template ($sources_file = "") {
- file { "/etc/apt/sources.list.d/$sources_file":
- content => template($name),
- notify => Exec['refresh_apt']
- }
-}
-
diff --git a/manifests/init.pp b/manifests/init.pp
index 6938c2c..28fea99 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -5,8 +5,6 @@
class apt {
- import "custom_sources.pp"
-
# See README
$real_apt_clean = $apt_clean ? {
'' => 'auto',
@@ -86,8 +84,7 @@ class apt {
config_file {
# include main, security and backports
- # additional sources should be included via the custom_sources_template
- # define
+ # additional sources should be included via the apt::sources_list define
"/etc/apt/sources.list":
content => $custom_sources_list ? {
'' => template( "apt/$operatingsystem/sources.list.erb"),
@@ -96,13 +93,13 @@ class apt {
require => Package['lsb'];
}
- apt_conf_snippet{ "02show_upgraded":
+ apt_conf { "02show_upgraded":
source => ["puppet:///modules/site-apt/${fqdn}/02show_upgraded",
"puppet:///modules/site-apt/02show_upgraded",
"puppet:///modules/apt/02show_upgraded"]
}
- apt_conf_snippet{ "03clean":
+ apt_conf { "03clean":
source => ["puppet:///modules/site-apt/${fqdn}/03clean",
"puppet:///modules/site-apt/03clean",
"puppet:///modules/apt/03clean"]
diff --git a/manifests/proxy-client.pp b/manifests/proxy_client.pp
index 30bda8a..9883933 100644
--- a/manifests/proxy-client.pp
+++ b/manifests/proxy_client.pp
@@ -1,4 +1,4 @@
-class apt::proxy-client {
+class apt::proxy_client {
$real_apt_proxy = $apt_proxy ? {
"" => "localhost",
@@ -10,7 +10,7 @@ class apt::proxy-client {
default => $apt_proxy_port
}
- apt_conf_snippet { "20proxy":
+ apt_conf { "20proxy":
content => template("apt/20proxy.erb"),
}
}
diff --git a/manifests/sources_list.pp b/manifests/sources_list.pp
new file mode 100644
index 0000000..d3f18d5
--- /dev/null
+++ b/manifests/sources_list.pp
@@ -0,0 +1,30 @@
+define apt::sources_list (
+ $ensure = 'present',
+ $source = '',
+ $content = undef
+) {
+ if $source == '' and $content == undef {
+ fail("One of \$source or \$content must be specified for apt_sources_snippet ${name}")
+ }
+ if $source != '' and $content != undef {
+ fail("Only one of \$source or \$content must specified for apt_sources_snippet ${name}")
+ }
+
+ file { "/etc/apt/sources.list.d/${name}":
+ ensure => $ensure,
+ notify => Exec['refresh_apt'],
+ owner => root, group => 0, mode => 0600;
+ }
+
+ if $source {
+ File["/etc/apt/sources.list.d/${name}"] {
+ source => $source,
+ }
+ }
+ else {
+ File["/etc/apt/sources.list.d/${name}"] {
+ content => $content,
+ }
+ }
+}
+
diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp
index 6a0c685..fb04193 100644
--- a/manifests/unattended_upgrades.pp
+++ b/manifests/unattended_upgrades.pp
@@ -4,7 +4,7 @@ class apt::unattended_upgrades {
require => undef,
}
- apt_conf_snippet { "50unattended-upgrades":
+ apt_conf { "50unattended-upgrades":
source => ["puppet:///modules/site-apt/50unattended-upgrades",
"puppet:///modules/apt/50unattended-upgrades" ],