diff options
-rw-r--r-- | modules/buildsystem/manifests/create_upload_dir.rb | 23 | ||||
-rw-r--r-- | modules/buildsystem/manifests/mgarepo.pp | 20 |
2 files changed, 19 insertions, 24 deletions
diff --git a/modules/buildsystem/manifests/create_upload_dir.rb b/modules/buildsystem/manifests/create_upload_dir.rb index 609d7dd4..dd30d00d 100644 --- a/modules/buildsystem/manifests/create_upload_dir.rb +++ b/modules/buildsystem/manifests/create_upload_dir.rb @@ -1,23 +1,4 @@ -define "create_upload_dir", :owner, :group do - - #FIXME: move this config info outside of this code - releases = { - 'cauldron' => { - 'core' => ['release','updates_testing','backports_testing','backports','updates'], - 'nonfree' => ['release','updates_testing','backports_testing','backports','updates'], - 'tainted' => ['release','updates_testing','backports_testing','backports','updates'], - }, - '1' => { - 'core' => ['release','updates_testing','backports_testing','backports','updates'], - 'nonfree' => ['release','updates_testing','backports_testing','backports','updates'], - 'tainted' => ['release','updates_testing','backports_testing','backports','updates'], - }, - 'infra_1' => { - 'infra' => ['release'] - }, - } - - +define "create_upload_dir", :owner, :group, :releases do states = ["todo","done","failure","queue","rejected"] file @name, :ensure => 'directory', :owner => @owner, :group => @group @@ -25,7 +6,7 @@ define "create_upload_dir", :owner, :group do for st in states do file [@name, st].join('/'), :ensure => 'directory', :owner => @owner, :group => @group - releases.each{|rel, repositories| + @releases.each{|rel, repositories| file [@name, st, rel].join('/'), :ensure => 'directory', :owner => @owner, :group => @group repositories.each{|rep, medias| diff --git a/modules/buildsystem/manifests/mgarepo.pp b/modules/buildsystem/manifests/mgarepo.pp index c4747e3c..44007889 100644 --- a/modules/buildsystem/manifests/mgarepo.pp +++ b/modules/buildsystem/manifests/mgarepo.pp @@ -34,13 +34,27 @@ class buildsystem { # require => File[$sched_home_dir], #} - # too tedious to create everything by hand - # so I prefered to used some puppet ruby module - # the exact content and directory name should IMHO be consolidated somewhere + $releases = { + 'cauldron' => { + 'core' => ['release','updates_testing','backports_testing','backports','updates'], + 'nonfree' => ['release','updates_testing','backports_testing','backports','updates'], + 'tainted' => ['release','updates_testing','backports_testing','backports','updates'], + }, + '1' => { + 'core' => ['release','updates_testing','backports_testing','backports','updates'], + 'nonfree' => ['release','updates_testing','backports_testing','backports','updates'], + 'tainted' => ['release','updates_testing','backports_testing','backports','updates'], + }, + 'infra_1' => { + 'infra' => ['release'] + }, + } + import "create_upload_dir.rb" create_upload_dir { "$sched_home_dir/uploads": owner => $sched_login, group => $sched_login, + releases => $releases, } Tidy { |