Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

apt: when a source change, apt-get update gets executed

  • Loading branch information...
commit 82582515f03abee81e5e174b674165c53669806c 1 parent ea2353d
@daks authored
View
8 apt/README
@@ -25,13 +25,19 @@ apt::proxy
the proxy in the usual form "http://proxy.my.domain:port"
+apt::update
+
+ updates apt packages lists. It gets executed each time a source change
+
+
Definitions
-----------
apt::source
add a specific packages source. It simply creates a new file in the
- /etc/apt/sources.list.d/ directory with the corresponding information
+ /etc/apt/sources.list.d/ directory with the corresponding information,
+ and executes apt::update class
parameters:
View
2  apt/manifests/init.pp
@@ -2,6 +2,8 @@
class apt {
+ include apt::update
+
$directories = ["/etc/apt/apt.conf.d", "/etc/apt/sources.list.d"]
file { $directories:
ensure => "directory",
View
3  apt/manifests/source.pp
@@ -2,7 +2,8 @@
define apt::source($uri, $dist=$lsbdistcodename, $components='main', $src=false) {
file { "/etc/apt/sources.list.d/${name}.list":
- content => template("apt/sources.list.erb")
+ content => template("apt/sources.list.erb"),
+ notify => Class["apt::update"],
}
}
View
7 apt/manifests/update.pp
@@ -0,0 +1,7 @@
+# modules/apt/manifests/update.pp
+
+class apt::update {
+ exec { "apt-get update":
+ refreshonly => "true",
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.