From 8f1cd256078a879071dac9b91a0f7f3fe23aa2a8 Mon Sep 17 00:00:00 2001 From: Garth Kidd Date: Wed, 4 Apr 2012 17:49:10 +1000 Subject: [PATCH] Merged changes by lelutin for file source variety and picking versions. I used a class variable rather than global for style reasons. --- README.md | 4 +++- manifests/init.pp | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 90199dd..f463c75 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,11 @@ Maintainer of this fork: [Garth Kidd] cd /etc/puppet/modules git clone git://github.com/garthk/puppet-apt-cacher-ng apt-cacher-ng -* Edit the definition for your server to include `apt-cacher-ng`: +* Edit the definition for your server to include `apt-cacher-ng`, perhaps + specifying `version`: class { 'apt-cacher-ng': + # version => '0.4.6-1ubuntu1', } * Edit the definition for your clients to include `apt-cacher-ng::client`: diff --git a/manifests/init.pp b/manifests/init.pp index 9eb6f12..5c71fa6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,6 +1,6 @@ -class apt-cacher-ng { +class apt-cacher-ng($version = 'installed') { package { 'apt-cacher-ng': - ensure => present, + ensure => $version, } service { 'apt-cacher-ng': @@ -9,7 +9,9 @@ } file { "/etc/apt-cacher-ng/acng.conf": - source => "puppet:///apt-cacher-ng/acng.conf", + source => ["puppet:///site-apt-cacher-ng/$fqdn/acng.conf", + "puppet:///site-apt-cacher-ng/acng.conf", + "puppet:///apt-cacher-ng/acng.conf"], notify => Service['apt-cacher-ng'], require => Package['apt-cacher-ng'], }