diff options
-rw-r--r-- | modules/buildsystem/manifests/distros.rb | 40 | ||||
-rw-r--r-- | modules/buildsystem/manifests/mainnode.pp | 1 |
2 files changed, 41 insertions, 0 deletions
diff --git a/modules/buildsystem/manifests/distros.rb b/modules/buildsystem/manifests/distros.rb new file mode 100644 index 00000000..6ecc7240 --- /dev/null +++ b/modules/buildsystem/manifests/distros.rb @@ -0,0 +1,40 @@ +hostclass "buildsystem::distros" do + include 'buildsystem::var::repository' + include 'buildsystem::var::scheduler' + include 'buildsystem::var::distros' + + mirror_user = 'root' + schedbot_user = scope.lookupvar('buildsystem::var::scheduler::login') + bootstrap_reporoot = scope.lookupvar('buildsystem::var::repository::bootstrap_reporoot') + scope.lookupvar('buildsystem::var::distros::distros').each{|rel, distro| + file [ bootstrap_reporoot, rel ].join('/'), :ensure => 'directory', + :owner => mirror_user, :group => mirror_user + for arch in distro['arch'] do + file [ bootstrap_reporoot, rel, arch ].join('/'), + :ensure => 'directory', :owner => mirror_user, + :group => mirror_user + mediadir = [ bootstrap_reporoot, rel, arch, 'media' ].join('/') + file mediadir, :ensure => 'directory', :owner => mirror_user, + :group => mirror_user + file [ mediadir, 'media_info' ].join('/'), :ensure => 'directory', + :owner => mirror_user, :group => mirror_user + file [ mediadir, 'debug' ].join('/'), :ensure => 'directory', + :owner => mirror_user, :group => mirror_user + distro['medias'].each{|media, m| + file [ mediadir, media ].join('/'), :ensure => 'directory', + :owner => schedbot_user, :group => schedbot_user + file [ mediadir, 'debug', media ].join('/'), + :ensure => 'directory', :owner => schedbot_user, + :group => schedbot_user + for repo in m['repos'].keys do + file [ mediadir, media, repo ].join('/'), + :ensure => 'directory', :owner => schedbot_user, + :group => schedbot_user + file [ mediadir, 'debug', media, repo ].join('/'), + :ensure => 'directory', :owner => schedbot_user, + :group => schedbot_user + end + } + end + } +end diff --git a/modules/buildsystem/manifests/mainnode.pp b/modules/buildsystem/manifests/mainnode.pp index 08f4d1f2..96e8cc0d 100644 --- a/modules/buildsystem/manifests/mainnode.pp +++ b/modules/buildsystem/manifests/mainnode.pp @@ -7,6 +7,7 @@ class buildsystem::mainnode { include buildsystem::signbot include buildsystem::youri_submit include buildsystem::sshkeys + include buildsystem::distros ssh::auth::client { $buildsystem::var::scheduler::login: } |