Permalink
Browse files

Full overhaul with tests

This commit is an almost complete refactor of the previous module. It removes
some of the levers and switches with the repos and instead of using the name of
a mock config to figure out how it is laid out, this uses the parameters of a
mock config to determine its name. The entry point of init.pp now collects some
common params and hands them down to the other manifests if provided.
  • Loading branch information...
1 parent 1ae07ff commit 40e21201f8c8d3741565d7083b99357156dd208f @haus haus committed Aug 31, 2012
View
@@ -1,2 +1,3 @@
-require 'rubygems'
+require 'rake'
+require 'rspec/core/rake_task'
require 'puppetlabs_spec_helper/rake_tasks'
View
@@ -1,6 +1,28 @@
-class rpmbuilder {
+class rpmbuilder(
+ $fedora_releases = undef,
+ $el_releases = undef,
+ $vendor = undef,
+ $mock_root = undef,
+ $proxy = undef,
+ $pe = false,
+ $pe_vers = undef,
+) {
include rpmbuilder::repos
include rpmbuilder::packages::essential
- include rpmbuilder::packages::extra
- include rpmbuilder::mock::puppetlabs_mocks
+
+ class { rpmbuilder::mock::puppetlabs_mocks:
+ fedora_releases => $fedora_releases,
+ el_releases => $el_releases,
+ vendor => $vendor,
+ proxy => $proxy,
+ mock_root => $mock_root,
+ }
+
+ if $pe {
+ include rpmbuilder::packages::extra
+ class { rpmbuilder::mock::pe_mocks:
+ pe_vers => $pe_vers,
+ mock_root => $mock_root,
+ }
+ }
}
@@ -0,0 +1,20 @@
+define rpmbuilder::mock::create_mock (
+ $dist = undef,
+ $release = undef,
+ $proxy = false,
+ $vendor = "Puppet User",
+ $arch = undef,
+ $dev = false,
+ $mock_root = "/etc/mock",
+) {
+
+ file { $name:
+ path => "${mock_root}/${name}.cfg",
+ owner => "root",
+ group => "mock",
+ ensure => present,
+ content => template("rpmbuilder/mock-config.erb"),
+ mode => "0644",
+ }
+
+}
@@ -1,31 +0,0 @@
-define rpmbuilder::mock::pe_config (
- $config,
- $build_root,
- $target_arch,
- $legal_host_arches = "'i386','i586','i686','x86_64'",
- $chroot_setup_cmd = "install bash bzip2 coreutils cpio curl cvs diffutils\
- fedpkg findutils gawk gcc gcc-c++ gnupg grep gzip info make patch redhat-release\
- redhat-release-server redhat-rpm-config rpm-build sed shadow-utils tar unzip\
- util-linux-ng which xz buildsys-macros",
- $dist,
- $ccache_enable = 'False',
- $dist_macro = undef,
- $base_repo_baseurl = undef,
- $base_mirrorlist = undef,
- $updates_repo_baseurl = undef,
- $updates_repo_enabled = '1',
- $updates_mirrorlist = undef,
- $pe_repo_baseurl,
- $extras_repo_baseurl = undef,
- $failover_priority = undef,
-) {
-
- file { "${config}":
- ensure => present,
- mode => '0644',
- owner => 'root',
- group => 'root',
- content => template("rpmbuilder/pupent-mock-config.erb"),
- require => Package['mock'],
- }
-}
View
@@ -0,0 +1,16 @@
+define rpmbuilder::mock::pe_mock(
+ $pe_ver,
+ $dist = "el",
+ $release,
+ $arch,
+ $mock_root = "/etc/mock"
+) {
+ file { $name:
+ path => "${mock_root}/${name}.cfg",
+ owner => "root",
+ group => "mock",
+ ensure => present,
+ content => template("rpmbuilder/pe-mock-config.erb"),
+ mode => "0644",
+ }
+}
Oops, something went wrong.

0 comments on commit 40e2120

Please sign in to comment.