From 581bd6f082cd82e993b34f2b5d7fa3b3b14b9927 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Thu, 23 May 2013 15:07:15 +0000 Subject: buildsystem::var::distros: add tmpl_media.cfg It is now possible to specify a different template file for media.cfg for each distribution, using the 'tmpl_media.cfg' option in the distros variable from buildsystem::Var::distros. If the option is not set, the default template (buildsystem/media.cfg) is used. --- modules/buildsystem/manifests/distros.rb | 10 ++++++++-- modules/buildsystem/manifests/var/distros.pp | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/buildsystem/manifests/distros.rb b/modules/buildsystem/manifests/distros.rb index 22e529eb..4dc5f2b6 100644 --- a/modules/buildsystem/manifests/distros.rb +++ b/modules/buildsystem/manifests/distros.rb @@ -14,9 +14,15 @@ hostclass "buildsystem::distros" do # workaround with 'find_resource_type' as described in this # puppet issue: http://projects.puppetlabs.com/issues/11912 scope.find_resource_type 'buildsystem::media_cfg' + media_cfg_args = { + :distro_name => rel, + :arch => arch, + } + if distro['tmpl_media.cfg'] != nil + media_cfg_args['templatefile'] = distro['tmpl_media.cfg'] + end create_resource 'buildsystem::media_cfg', - [ rel, ' ', arch ].join('/'), :distro_name => rel, - :arch => arch + [ rel, ' ', arch ].join('/'), media_cfg_args file [ bootstrap_reporoot, rel, arch ].join('/'), :ensure => 'directory', :owner => mirror_user, :group => mirror_user diff --git a/modules/buildsystem/manifests/var/distros.pp b/modules/buildsystem/manifests/var/distros.pp index 79cbb239..5640d6e5 100644 --- a/modules/buildsystem/manifests/var/distros.pp +++ b/modules/buildsystem/manifests/var/distros.pp @@ -44,6 +44,9 @@ # }, # # the list of media used by iurt to build the chroots # 'base_medias' => [ 'core/release' ], +# # optionally, a media.cfg template file can be specified, if +# # the default one should not be used +# 'tmpl_media.cfg' => 'buildsystem/something', # # branch is Devel or Official. Used in media.cfg. # 'branch' => 'Devel', # # Version of the distribution -- cgit v1.2.1