From e95ac6b120f9d43e4b8c1dccd0badd1ced3b1fee Mon Sep 17 00:00:00 2001 From: nadir Date: Wed, 17 Feb 2010 13:54:05 +0100 Subject: [PATCH] added apt::custom_sources_template to deploy custom sources.list.d/xyz.list from templates --- README | 6 ++++++ manifests/init.pp | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README b/README index 60c16a0..9968c03 100644 --- a/README +++ b/README @@ -146,6 +146,12 @@ upgrade_package { "perl": "perl-modules": } +apt::custom_sources_template +---------------------------- +Deploys custom sources in /etc/apt/sources.list.d, i.e. + + apt::custom_sources_template { "site-apt/my-repository.list.erb": sources_file => "my-repository.list" } + TODO ==== diff --git a/manifests/init.pp b/manifests/init.pp index e459bd8..9a59e0c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -53,8 +53,19 @@ class apt { require => Exec[assert_lsbdistcodename]; } } - - case $custom_preferences { + + define custom_sources_template ($sources_file = "") { + file { "/etc/apt/sources.list.d/$sources_file": + content => template($name), + require => Exec[assert_lsbdistcodename]; + } + exec { "/usr/bin/apt-get update": + subscribe => File["/etc/apt/sources.list.d/$sources_file"], + refreshonly => true, + } + } + + case $custom_preferences { '': { include default_preferences }