diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-05-23 15:05:28 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-05-23 15:05:28 +0000 |
commit | 98fa28e23cbd8ac75e428b1bee6b89cdbbe0d5bf (patch) | |
tree | 0aa24b1f9c790ad0e484f9cb52176623011e51b3 /modules/buildsystem/manifests | |
parent | 64099eaa3dd3b6d42f30355f4ae11abdbe1e280f (diff) | |
download | puppet-98fa28e23cbd8ac75e428b1bee6b89cdbbe0d5bf.tar puppet-98fa28e23cbd8ac75e428b1bee6b89cdbbe0d5bf.tar.gz puppet-98fa28e23cbd8ac75e428b1bee6b89cdbbe0d5bf.tar.bz2 puppet-98fa28e23cbd8ac75e428b1bee6b89cdbbe0d5bf.tar.xz puppet-98fa28e23cbd8ac75e428b1bee6b89cdbbe0d5bf.zip |
buildsystem: use common media.cfg template for all distros
The media.cfg file is now generated for all distributions now (it was
only done for cauldron before). The media.cfg file is generated using
the infos about the distributions and medias from the $distro parameter
in buildsystem::var::distros.
Diffstat (limited to 'modules/buildsystem/manifests')
-rw-r--r-- | modules/buildsystem/manifests/distros.rb | 7 | ||||
-rw-r--r-- | modules/buildsystem/manifests/mainnode.pp | 9 | ||||
-rw-r--r-- | modules/buildsystem/manifests/media_cfg.pp | 4 | ||||
-rw-r--r-- | modules/buildsystem/manifests/var/distros.pp | 14 |
4 files changed, 22 insertions, 12 deletions
diff --git a/modules/buildsystem/manifests/distros.rb b/modules/buildsystem/manifests/distros.rb index 6ecc7240..24b394aa 100644 --- a/modules/buildsystem/manifests/distros.rb +++ b/modules/buildsystem/manifests/distros.rb @@ -10,6 +10,13 @@ hostclass "buildsystem::distros" do file [ bootstrap_reporoot, rel ].join('/'), :ensure => 'directory', :owner => mirror_user, :group => mirror_user for arch in distro['arch'] do + # As ruby dsl cannot use defined resources, we have to use a + # workaround with 'find_resource_type' as described in this + # puppet issue: http://projects.puppetlabs.com/issues/11912 + scope.find_resource_type 'buildsystem::media_cfg' + create_resource 'buildsystem::media_cfg', + [ rel, ' ', arch ].join('/'), :distro_name => rel, + :arch => arch file [ bootstrap_reporoot, rel, arch ].join('/'), :ensure => 'directory', :owner => mirror_user, :group => mirror_user diff --git a/modules/buildsystem/manifests/mainnode.pp b/modules/buildsystem/manifests/mainnode.pp index 96e8cc0d..2a4834a0 100644 --- a/modules/buildsystem/manifests/mainnode.pp +++ b/modules/buildsystem/manifests/mainnode.pp @@ -14,13 +14,4 @@ class buildsystem::mainnode { apache::vhost::other_app { "repository.$::domain": vhost_file => 'buildsystem/vhost_repository.conf', } - - buildsystem::media_cfg { "cauldron i586": - distro => 'cauldron', - arch => 'i586', - } - buildsystem::media_cfg { "cauldron x86_64": - distro => 'cauldron', - arch => 'x86_64', - } } diff --git a/modules/buildsystem/manifests/media_cfg.pp b/modules/buildsystem/manifests/media_cfg.pp index 413aa71f..bdec67f7 100644 --- a/modules/buildsystem/manifests/media_cfg.pp +++ b/modules/buildsystem/manifests/media_cfg.pp @@ -1,9 +1,9 @@ -define buildsystem::media_cfg($distro, $arch, $templatefile = 'buildsystem/media.cfg') { +define buildsystem::media_cfg($distro_name, $arch, $templatefile = 'buildsystem/media.cfg') { include buildsystem::var::repository include buildsystem::var::scheduler include buildsystem::repository - file { "${buildsystem::var::repository::bootstrap_reporoot}/${distro}/${arch}/media/media_info/media.cfg": + file { "${buildsystem::var::repository::bootstrap_reporoot}/${distro_name}/${arch}/media/media_info/media.cfg": owner => $buildsystem::var::scheduler::login, group => $buildsystem::var::scheduler::login, content => template($templatefile), diff --git a/modules/buildsystem/manifests/var/distros.pp b/modules/buildsystem/manifests/var/distros.pp index d06e31c9..a0c8aafd 100644 --- a/modules/buildsystem/manifests/var/distros.pp +++ b/modules/buildsystem/manifests/var/distros.pp @@ -12,12 +12,24 @@ # 'core' => { # 'repos' => { # # the 'release' repo in the 'core' media -# 'release' => {}, +# 'release' => { +# 'media_types' => [ 'release' ], +# 'noauto' => '1', +# }, # }, +# # media_types for media.cfg +# 'media_types' => [ 'official', 'free' ], +# # if noauto is set to '1' either in medias or repos, +# # the option will be added to media.cfg +# 'noauto' => '1', # }, # }, # # the list of media used by iurt to build the chroots # 'base_medias' => [ 'core/release' ], +# # branch is Devel or Official. Used in media.cfg. +# 'branch' => 'Devel', +# # Version of the distribution +# 'version' => '3', # }, # } class buildsystem::var::distros( |