Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 40e21201f8c8d3741565d7083b99357156dd208f 1 parent 1ae07ff
Matthaus Owens haus authored

Showing 28 changed files with 577 additions and 936 deletions. Show diff stats Hide diff stats

  1. +2 1  Rakefile
  2. +25 3 manifests/init.pp
  3. +20 0 manifests/mock/create_mock.pp
  4. +0 31 manifests/mock/pe_config.pp
  5. +16 0 manifests/mock/pe_mock.pp
  6. +27 289 manifests/mock/pe_mocks.pp
  7. +8 0 manifests/mock/pe_mockset.pp
  8. +0 33 manifests/mock/pl_config.pp
  9. +48 0 manifests/mock/pl_mocks.pp
  10. +20 261 manifests/mock/puppetlabs_mocks.pp
  11. +6 6 manifests/packages/essential.pp
  12. +1 1  manifests/repos.pp
  13. +4 5 spec/classes/packages_essential_spec.rb
  14. +1 1  spec/classes/packages_extra_spec.rb
  15. +33 35 spec/classes/pe_mocks_spec.rb
  16. +40 24 spec/classes/puppetlabs_mocks_spec.rb
  17. +48 9 spec/classes/rpmbuilder_spec.rb
  18. +0 25 spec/defines/config_spec.rb
  19. +43 0 spec/defines/create_mock_spec.rb
  20. +43 0 spec/defines/pe_mock_spec.rb
  21. +16 0 spec/defines/pe_mockset_spec.rb
  22. +0 32 spec/defines/pl_config_spec.rb
  23. +48 0 spec/defines/pl_mocks_spec.rb
  24. +10 1 spec/spec_helper.rb
  25. +70 0 templates/mock-config.erb
  26. +48 0 templates/pe-mock-config.erb
  27. +0 104 templates/pl-mock-config.erb
  28. +0 75 templates/pupent-mock-config.erb
3  Rakefile
... ... @@ -1,2 +1,3 @@
1   -require 'rubygems'
  1 +require 'rake'
  2 +require 'rspec/core/rake_task'
2 3 require 'puppetlabs_spec_helper/rake_tasks'
28 manifests/init.pp
... ... @@ -1,6 +1,28 @@
1   -class rpmbuilder {
  1 +class rpmbuilder(
  2 + $fedora_releases = undef,
  3 + $el_releases = undef,
  4 + $vendor = undef,
  5 + $mock_root = undef,
  6 + $proxy = undef,
  7 + $pe = false,
  8 + $pe_vers = undef,
  9 +) {
2 10 include rpmbuilder::repos
3 11 include rpmbuilder::packages::essential
4   - include rpmbuilder::packages::extra
5   - include rpmbuilder::mock::puppetlabs_mocks
  12 +
  13 + class { rpmbuilder::mock::puppetlabs_mocks:
  14 + fedora_releases => $fedora_releases,
  15 + el_releases => $el_releases,
  16 + vendor => $vendor,
  17 + proxy => $proxy,
  18 + mock_root => $mock_root,
  19 + }
  20 +
  21 + if $pe {
  22 + include rpmbuilder::packages::extra
  23 + class { rpmbuilder::mock::pe_mocks:
  24 + pe_vers => $pe_vers,
  25 + mock_root => $mock_root,
  26 + }
  27 + }
6 28 }
20 manifests/mock/create_mock.pp
... ... @@ -0,0 +1,20 @@
  1 +define rpmbuilder::mock::create_mock (
  2 + $dist = undef,
  3 + $release = undef,
  4 + $proxy = false,
  5 + $vendor = "Puppet User",
  6 + $arch = undef,
  7 + $dev = false,
  8 + $mock_root = "/etc/mock",
  9 +) {
  10 +
  11 + file { $name:
  12 + path => "${mock_root}/${name}.cfg",
  13 + owner => "root",
  14 + group => "mock",
  15 + ensure => present,
  16 + content => template("rpmbuilder/mock-config.erb"),
  17 + mode => "0644",
  18 + }
  19 +
  20 +}
31 manifests/mock/pe_config.pp
... ... @@ -1,31 +0,0 @@
1   -define rpmbuilder::mock::pe_config (
2   - $config,
3   - $build_root,
4   - $target_arch,
5   - $legal_host_arches = "'i386','i586','i686','x86_64'",
6   - $chroot_setup_cmd = "install bash bzip2 coreutils cpio curl cvs diffutils\
7   - fedpkg findutils gawk gcc gcc-c++ gnupg grep gzip info make patch redhat-release\
8   - redhat-release-server redhat-rpm-config rpm-build sed shadow-utils tar unzip\
9   - util-linux-ng which xz buildsys-macros",
10   - $dist,
11   - $ccache_enable = 'False',
12   - $dist_macro = undef,
13   - $base_repo_baseurl = undef,
14   - $base_mirrorlist = undef,
15   - $updates_repo_baseurl = undef,
16   - $updates_repo_enabled = '1',
17   - $updates_mirrorlist = undef,
18   - $pe_repo_baseurl,
19   - $extras_repo_baseurl = undef,
20   - $failover_priority = undef,
21   -) {
22   -
23   - file { "${config}":
24   - ensure => present,
25   - mode => '0644',
26   - owner => 'root',
27   - group => 'root',
28   - content => template("rpmbuilder/pupent-mock-config.erb"),
29   - require => Package['mock'],
30   - }
31   -}
16 manifests/mock/pe_mock.pp
... ... @@ -0,0 +1,16 @@
  1 +define rpmbuilder::mock::pe_mock(
  2 + $pe_ver,
  3 + $dist = "el",
  4 + $release,
  5 + $arch,
  6 + $mock_root = "/etc/mock"
  7 +) {
  8 + file { $name:
  9 + path => "${mock_root}/${name}.cfg",
  10 + owner => "root",
  11 + group => "mock",
  12 + ensure => present,
  13 + content => template("rpmbuilder/pe-mock-config.erb"),
  14 + mode => "0644",
  15 + }
  16 +}
316 manifests/mock/pe_mocks.pp
... ... @@ -1,299 +1,37 @@
1   -class rpmbuilder::mock::pe_mocks {
2   -
3   - $mock_path = '/etc/mock'
4   - Package['mock'] -> Rpmbuilder::Mock::Pe_config<| |>
5   -
6   - rpmbuilder::mock::pe_config { 'pupent-1.1-el4-i386-cve.cfg':
7   - config => "${mock_path}/pupent-1.1-el4-i386-cve.cfg",
8   - build_root => 'pupent-1.1-el4-i386-cve',
9   - target_arch => 'i386',
10   - dist => 'el4',
11   - dist_macro => '.el4',
12   - base_repo_baseurl => 'http://vault.centos.org/4.9/os/i386',
13   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-4-i386',
14   - }
15   -
16   - rpmbuilder::mock::pe_config { 'pupent-1.1-el4-x86_64-cve.cfg':
17   - config => "${mock_path}/pupent-1.1-el4-x86_64-cve.cfg",
18   - build_root => 'pupent-1.1-el4-x86_64-cve',
19   - target_arch => 'x86_64',
20   - dist => 'el4',
21   - dist_macro => '.el4',
22   - base_repo_baseurl => 'http://vault.centos.org/4.9/os/x86_64/',
23   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-4-x86_64',
24   - }
25   -
26   - rpmbuilder::mock::pe_config { 'pupent-1.1-el5-i386-cve.cfg':
27   - config => "${mock_path}/pupent-1.1-el5-i386-cve.cfg",
28   - build_root => 'pupent-1.1-el5-i386-cve',
29   - target_arch => 'i386',
30   - dist => 'el5',
31   - dist_macro => '.el5',
32   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-i386/RPMS.os',
33   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-5-i386/',
34   - }
35   -
36   - rpmbuilder::mock::pe_config { 'pupent-1.1-el5-x86_64-cve.cfg':
37   - config => "${mock_path}/pupent-1.1-el5-x86_64-cve.cfg",
38   - build_root => 'pupent-1.1-el5-x86_64-cve',
39   - target_arch => 'x86_64',
40   - dist => 'el5',
41   - dist_macro => '.el5',
42   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
43   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-5-x86_64',
44   - }
45   -
46   - rpmbuilder::mock::pe_config { 'pupent-1.1-el6-i386-cve.cfg':
47   - config => "${mock_path}/pupent-1.1-el6-i386-cve.cfg",
48   - build_root => 'pupent-1.1-el6-i386-cve',
49   - target_arch => 'i386',
50   - dist => 'el6',
51   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-i386/RPMS.os',
52   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-6-i386',
53   - failover_priority => 'base',
54   - }
55   - rpmbuilder::mock::pe_config { 'pupent-1.1-el6-x86_64-cve.cfg':
56   - config => "${mock_path}/pupent-1.1-el6-x86_64-cve.cfg",
57   - build_root => 'pupent-1.1-el6-x86_64-cve',
58   - target_arch => 'x86_64',
59   - dist => 'el6',
60   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
61   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-6-x86_64',
62   - }
63   -
64   - rpmbuilder::mock::pe_config { 'pupent-1.2-el4-i386-cve.cfg':
65   - config => "${mock_path}/pupent-1.2-el4-i386-cve.cfg",
66   - build_root => 'pupent-1.2-el4-i386-cve',
67   - target_arch => 'i386',
68   - dist => 'el4',
69   - dist_macro => '.el4',
70   - base_repo_baseurl => 'http://vault.centos.org/4.9/os/i386',
71   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-4-i386',
72   - }
73   -
74   - rpmbuilder::mock::pe_config { 'pupent-1.2-el4-x86_64-cve.cfg':
75   - config => "${mock_path}/pupent-1.2-el4-x86_64-cve.cfg",
76   - build_root => 'pupent-1.2-el4-x86_64-cve',
77   - target_arch => 'x86_64',
78   - dist => 'el4',
79   - dist_macro => '.el4',
80   - base_repo_baseurl => 'http://vault.centos.org/4.9/os/x86_64/',
81   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-4-x86_64',
82   - }
83   -
84   - rpmbuilder::mock::pe_config { 'pupent-1.2-el5-i386-cve.cfg':
85   - config => "${mock_path}/pupent-1.2-el5-i386-cve.cfg",
86   - build_root => 'pupent-1.2-el5-i386-cve',
87   - target_arch => 'i386',
88   - dist => 'el5',
89   - dist_macro => '.el5',
90   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-i386/RPMS.os',
91   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-5-i386/',
92   - }
93   -
94   - rpmbuilder::mock::pe_config { 'pupent-1.2-el5-x86_64-cve.cfg':
95   - config => "${mock_path}/pupent-1.2-el5-x86_64-cve.cfg",
96   - build_root => 'pupent-1.2-el5-x86_64-cve',
97   - target_arch => 'x86_64',
98   - dist => 'el5',
99   - dist_macro => '.el5',
100   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
101   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-5-x86_64',
102   - }
103   -
104   - rpmbuilder::mock::pe_config { 'pupent-1.2-el6-i386-cve.cfg':
105   - config => "${mock_path}/pupent-1.2-el6-i386-cve.cfg",
106   - build_root => 'pupent-1.2-el6-i386-cve',
107   - target_arch => 'i386',
108   - dist => 'el6',
109   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-i386/RPMS.os',
110   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-6-i386',
111   - failover_priority => 'base',
112   - }
113   -
114   - rpmbuilder::mock::pe_config { 'pupent-1.2-el6-x86_64-cve.cfg':
115   - config => "${mock_path}/pupent-1.2-el6-x86_64-cve.cfg",
116   - build_root => 'pupent-1.2-el6-x86_64-cve',
117   - target_arch => 'x86_64',
118   - dist => 'el6',
119   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
120   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-6-x86_64',
121   - }
122   -
123   - rpmbuilder::mock::pe_config { 'pupent-2.0-el4-i386-cve.cfg':
124   - config => "${mock_path}/pupent-2.0-el4-i386-cve.cfg",
125   - build_root => 'pupent-2.0-el4-i386-cve',
126   - target_arch => 'i386',
127   - dist => 'el4',
128   - dist_macro => '.el4',
129   - base_repo_baseurl => 'http://vault.centos.org/4.9/os/i386',
130   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-4-i386',
131   - }
132   -
133   - rpmbuilder::mock::pe_config { 'pupent-2.0-el4-x86_64-cve.cfg':
134   - config => "${mock_path}/pupent-2.0-el4-x86_64-cve.cfg",
135   - build_root => 'pupent-2.0-el4-x86_64-cve',
136   - target_arch => 'x86_64',
137   - dist => 'el4',
138   - dist_macro => '.el4',
139   - base_repo_baseurl => 'http://vault.centos.org/4.9/os/x86_64/',
140   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-4-x86_64',
141   - }
142   -
143   - rpmbuilder::mock::pe_config { 'pupent-2.0-el5-i386-cve.cfg':
144   - config => "${mock_path}/pupent-2.0-el5-i386-cve.cfg",
145   - build_root => 'pupent-2.0-el5-i386-cve',
146   - target_arch => 'i386',
147   - dist => 'el5',
148   - dist_macro => '.el5',
149   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-i386/RPMS.os',
150   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-5-i386/',
151   - }
152   -
153   - rpmbuilder::mock::pe_config { 'pupent-2.0-el5-x86_64-cve.cfg':
154   - config => "${mock_path}/pupent-2.0-el5-x86_64-cve.cfg",
155   - build_root => 'pupent-2.0-el5-x86_64-cve',
156   - target_arch => 'x86_64',
157   - dist => 'el5',
158   - dist_macro => '.el5',
159   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
160   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-5-x86_64',
161   - }
162   -
163   - rpmbuilder::mock::pe_config { 'pupent-2.0-el6-i386-cve.cfg':
164   - config => "${mock_path}/pupent-2.0-el6-i386-cve.cfg",
165   - build_root => 'pupent-2.0-el6-i386-cve',
166   - target_arch => 'i386',
167   - dist => 'el6',
168   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-i386/RPMS.os',
169   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-6-i386',
170   - failover_priority => 'base',
171   - }
172   -
173   - rpmbuilder::mock::pe_config { 'pupent-2.0-el6-x86_64-cve.cfg':
174   - config => "${mock_path}/pupent-2.0-el6-x86_64-cve.cfg",
175   - build_root => 'pupent-2.0-el6-x86_64-cve',
176   - target_arch => 'x86_64',
177   - dist => 'el6',
178   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
179   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-6-x86_64',
180   - }
181   -
182   - rpmbuilder::mock::pe_config { 'pupent-el4-i386.cfg':
183   - config => "${mock_path}/pupent-el4-i386.cfg",
184   - build_root => 'pupent-el4-i386',
185   - target_arch => 'i386',
186   - dist => 'el4',
187   - base_repo_baseurl => 'http://vault.centos.org/4.9/os/i386',
188   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-4-i386',
189   - }
190   -
191   - rpmbuilder::mock::pe_config { 'pupent-el4-x86_64.cfg':
192   - config => "${mock_path}/pupent-el4-x86_64.cfg",
193   - build_root => 'pupent-el4-x86_64',
194   - target_arch => 'x86_64',
195   - dist => 'el4',
196   - base_repo_baseurl => 'http://vault.centos.org/4.9/os/x86_64/',
197   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-4-x86_64',
198   - }
199   -
200   - rpmbuilder::mock::pe_config { 'pupent-el5-i386.cfg':
201   - config => "${mock_path}/pupent-el5-i386.cfg",
202   - build_root => 'pupent-el5-i386',
203   - target_arch => 'i386',
204   - dist => 'el5',
205   - dist_macro => '.el5',
206   - base_repo_baseurl => 'http://mirrors.cat.pdx.edu/centos/5/os/i386/',
207   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-5-i386/',
208   - }
209   -
210   - rpmbuilder::mock::pe_config { 'pupent-el5-x86_64.cfg':
211   - config => "${mock_path}/pupent-el5-x86_64.cfg",
212   - build_root => 'pupent-el5-x86_64',
213   - target_arch => 'x86_64',
214   - dist => 'el5',
215   - dist_macro => '.el5',
216   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
217   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-5-x86_64',
218   - }
219   -
220   - rpmbuilder::mock::pe_config { 'pupent-el6-i386.cfg':
221   - config => "${mock_path}/pupent-el6-i386.cfg",
222   - build_root => 'pupent-el6-i386',
223   - target_arch => 'i386',
224   - dist => 'el6',
225   - base_repo_baseurl => 'http://mirrors.cat.pdx.edu/centos/6/os/i386/',
226   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-6-i386',
227   - }
228   -
229   - rpmbuilder::mock::pe_config { 'pupent-el6-x86_64.cfg':
230   - config => "${mock_path}/pupent-el6-x86_64.cfg",
231   - build_root => 'pupent-el6-x86_64',
232   - target_arch => 'x86_64',
233   - dist => 'el6',
234   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
235   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-6-x86_64',
236   - }
237   -
238   - rpmbuilder::mock::pe_config { 'pupent-extras-el5-i386.cfg':
239   - config => "${mock_path}/pupent-extras-el5-i386.cfg",
240   - build_root => 'pupent-extras-el5-i386',
241   - target_arch => 'i386',
242   - dist => 'el5',
243   - dist_macro => '.el5',
244   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-i386/RPMS.os',
245   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-5-i386/',
246   - extras_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/yum-enterprise/el/5/extras/i386',
247   - }
248   -
249   - rpmbuilder::mock::pe_config { 'pupent-extras-el5-x86_64.cfg':
250   - config => "${mock_path}/pupent-extras-el5-x86_64.cfg",
251   - build_root => 'pupent-extras-el5-x86_64',
252   - target_arch => 'x86_64',
253   - dist => 'el5',
254   - dist_macro => '.el5',
255   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
256   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-5-x86_64',
257   - extras_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/yum-enterprise/el/5/extras/x86_64',
  1 +class rpmbuilder::mock::pe_mocks(
  2 + $pe_vers = ["1.2","2.0","2.5","2.6","2.7"],
  3 + $mock_root = '/etc/mock'
  4 +) {
  5 + # Default PE mocks for PE 1.2 through 2.7
  6 + rpmbuilder::mock::pe_mockset { $pe_vers:
  7 + mock_root => $mock_root,
258 8 }
259 9
260   - rpmbuilder::mock::pe_config { 'pupent-extras-el6-i386.cfg':
261   - config => "${mock_path}/pupent-extras-el6-i386.cfg",
262   - build_root => 'pupent-extras-el6-i386',
263   - target_arch => 'i386',
264   - dist => 'el6',
265   - base_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=i386&repo=os',
266   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-6-i386',
267   - extras_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/yum-enterprise/el/6/extras/i386',
  10 + rpmbuilder::mock::pe_mock { 'pupent-extras-el5-i386':
  11 + pe_ver => "2.5",
  12 + release => "5",
  13 + arch => "i386",
  14 + mock_root => $mock_root,
268 15 }
269 16
270   - rpmbuilder::mock::pe_config { 'pupent-extras-el6-x86_64.cfg':
271   - config => "${mock_path}/pupent-extras-el6-x86_64.cfg",
272   - build_root => 'pupent-extras-el6-x86_64',
273   - target_arch => 'x86_64',
274   - dist => 'el6',
275   - base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
276   - pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-6-x86_64',
277   - extras_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/yum-enterprise/el/6/extras/x86_64',
  17 + rpmbuilder::mock::pe_mock { 'pupent-extras-el5-x86_64':
  18 + pe_ver => "2.5",
  19 + release => "5",
  20 + arch => "x86_64",
  21 + mock_root => $mock_root,
278 22 }
279 23
280   - rpmbuilder::mock::pe_config { 'pupent-fc15-i386.cfg':
281   - config => "${mock_path}/pupent-fc15-i386.cfg",
282   - build_root => 'pupent-fc15-i386',
283   - target_arch => 'i386',
284   - legal_host_arches => 'i386',
285   - dist => 'fc15',
286   - base_repo_baseurl => 'http://localhost/os/fc/15/i386',
287   - pe_repo_baseurl => 'file:///tmp/output/pe/fc/15/i386',
  24 + rpmbuilder::mock::pe_mock { 'pupent-extras-el6-i386':
  25 + pe_ver => "2.5",
  26 + release => "6",
  27 + arch => "i386",
  28 + mock_root => $mock_root,
288 29 }
289 30
290   - rpmbuilder::mock::pe_config { 'pupent-fc15-x86_64.cfg':
291   - config => "${mock_path}/pupent-fc15-x86_64.cfg",
292   - build_root => 'pupent-fc15-x86_64',
293   - target_arch => 'x86_64',
294   - legal_host_arches => 'x86_64',
295   - dist => 'fc15',
296   - base_repo_baseurl => 'http://localhost/os/fc/15/x86_64',
297   - pe_repo_baseurl => 'file:///tmp/output/pe/fc/15/x86_64',
  31 + rpmbuilder::mock::pe_mock { 'pupent-extras-el6-x86_64':
  32 + pe_ver => "2.5",
  33 + release => "6",
  34 + arch => "x86_64",
  35 + mock_root => $mock_root,
298 36 }
299 37 }
8 manifests/mock/pe_mockset.pp
... ... @@ -0,0 +1,8 @@
  1 +define rpmbuilder::mock::pe_mockset(
  2 + mock_root = "/etc/mock",
  3 +) {
  4 + rpmbuilder::mock::pe_mock { "pupent-${name}-el5-i386": pe_ver => $name, release => '5', arch => 'i386', mock_root => $mock_root, }
  5 + rpmbuilder::mock::pe_mock { "pupent-${name}-el5-x86_64": pe_ver => $name, release => '5', arch => 'x86_64', mock_root => $mock_root, }
  6 + rpmbuilder::mock::pe_mock { "pupent-${name}-el6-i386": pe_ver => $name, release => '6', arch => 'i386', mock_root => $mock_root, }
  7 + rpmbuilder::mock::pe_mock { "pupent-${name}-el6-x86_64": pe_ver => $name, release => '6', arch => 'x86_64', mock_root => $mock_root, }
  8 +}
33 manifests/mock/pl_config.pp
... ... @@ -1,33 +0,0 @@
1   -define rpmbuilder::mock::pl_config (
2   - $config,
3   - $build_root,
4   - $target_arch,
5   - $legal_host_arches = "'i386','i586','i686','x86_64'",
6   - $chroot_setup_cmd = "groupinstall buildsys-build",
7   - $dist,
8   - $dist_macro = undef,
9   - $base_repo_baseurl = undef,
10   - $base_mirrorlist = undef,
11   - $base_debug_mirrorlist = undef,
12   - $updates_repo_baseurl = undef,
13   - $updates_mirrorlist = undef,
14   - $updates_debug_mirrorlist = undef,
15   - $updates_repo_enabled = '1',
16   - $debug_mirrorlist = undef,
17   - $puppet_prod_baseurl = undef,
18   - $puppet_deps_baseurl = undef,
19   - $puppet_dev_baseurl = undef,
20   - $epel_repo_mirrorlist = undef,
21   - $failover_priority = undef,
22   - $is_vendor_puppetlabs = undef,
23   -) {
24   -
25   - file { "${config}":
26   - ensure => present,
27   - mode => '0644',
28   - owner => 'root',
29   - group => 'root',
30   - content => template("rpmbuilder/pl-mock-config.erb"),
31   - require => Package['mock'],
32   - }
33   -}
48 manifests/mock/pl_mocks.pp
... ... @@ -0,0 +1,48 @@
  1 +define rpmbuilder::mock::pl_mocks (
  2 + $dist = undef,
  3 + $vendor = "Puppet User",
  4 + $proxy = undef,
  5 + $mock_root = undef,
  6 +) {
  7 +
  8 + rpmbuilder::mock::create_mock { "pl-${dist}-${name}-i386":
  9 + dist => $dist,
  10 + release => $name,
  11 + proxy => $proxy,
  12 + vendor => $vendor,
  13 + arch => "i386",
  14 + dev => false,
  15 + mock_root => $mock_root,
  16 + }
  17 +
  18 + rpmbuilder::mock::create_mock { "pl-${dist}-${name}-x86_64":
  19 + dist => $dist,
  20 + release => $name,
  21 + proxy => $proxy,
  22 + vendor => $vendor,
  23 + arch => "x86_64",
  24 + dev => false,
  25 + mock_root => $mock_root,
  26 + }
  27 +
  28 + rpmbuilder::mock::create_mock { "pl-${dist}-${name}-i386-dev":
  29 + dist => $dist,
  30 + release => $name,
  31 + proxy => $proxy,
  32 + vendor => $vendor,
  33 + arch => "i386",
  34 + dev => true,
  35 + mock_root => $mock_root,
  36 + }
  37 +
  38 + rpmbuilder::mock::create_mock { "pl-${dist}-${name}-x86_64-dev":
  39 + dist => $dist,
  40 + release => $name,
  41 + proxy => $proxy,
  42 + vendor => $vendor,
  43 + arch => "x86_64",
  44 + dev => true,
  45 + mock_root => $mock_root,
  46 + }
  47 +
  48 +}
281 manifests/mock/puppetlabs_mocks.pp
... ... @@ -1,263 +1,22 @@
1   -class rpmbuilder::mock::puppetlabs_mocks {
2   -
3   - $mock_path = '/etc/mock'
4   -
5   - Package['mock'] -> Rpmbuilder::Mock::Pl_config<| |>
6   -
7   - rpmbuilder::mock::pl_config { 'pl-5-i386.cfg':
8   - config => "${mock_path}/pl-5-i386.cfg",
9   - build_root => 'pl-5-i386',
10   - target_arch => 'i386',
11   - dist => 'el5',
12   - dist_macro => '.el5',
13   - base_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=i386&repo=os',
14   - updates_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=i386&repo=updates',
15   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/5/products/i386',
16   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/5/dependencies/i386',
17   - epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=i386',
18   - failover_priority => 'base',
19   - }
20   -
21   - rpmbuilder::mock::pl_config { 'pl-5-i386-dev.cfg':
22   - config => "${mock_path}/pl-5-i386-dev.cfg",
23   - build_root => 'pl-5-i386-dev',
24   - target_arch => 'i386',
25   - dist => 'el5',
26   - dist_macro => '.el5',
27   - base_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=i386&repo=os',
28   - updates_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=i386&repo=updates',
29   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/5/products/i386',
30   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/5/dependencies/i386',
31   - epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=i386',
32   - failover_priority => 'base',
33   - }
34   -
35   - rpmbuilder::mock::pl_config { 'pl-5-x86_64.cfg':
36   - config => "${mock_path}/pl-5-x86_64.cfg",
37   - build_root => 'pl-5-x86_64',
38   - target_arch => 'x86_64',
39   - dist => 'el5',
40   - dist_macro => '.el5',
41   - base_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=os',
42   - updates_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=updates',
43   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/5/products/x86_64',
44   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/5/dependencies/x86_64',
45   - epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=x86_64',
46   - failover_priority => 'base',
47   - }
48   -
49   - rpmbuilder::mock::pl_config { 'pl-5-x86_64-dev.cfg':
50   - config => "${mock_path}/pl-5-x86_64-dev.cfg",
51   - build_root => 'pl-5-x86_64-dev',
52   - target_arch => 'x86_64',
53   - dist => 'el5',
54   - dist_macro => '.el5',
55   - base_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=os',
56   - updates_mirrorlist => 'http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=updates',
57   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/5/products/x86_64/',
58   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/5/dependencies/x86_64/',
59   - puppet_dev_baseurl => 'http://yum.puppetlabs.com/el/5/devel/x86_64/',
60   - epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=x86_64',
61   - failover_priority => 'base',
62   - }
63   -
64   - rpmbuilder::mock::pl_config { 'pl-6-i386.cfg':
65   - config => "${mock_path}/pl-6-i386.cfg",
66   - build_root => 'pl-6-i386',
67   - target_arch => 'i386',
68   - dist => 'el6',
69   - base_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=i386&repo=os',
70   - updates_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=i386&repo=updates',
71   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/6/products/i386',
72   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/6/dependencies/i386',
73   - epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=i386',
74   - failover_priority => 'base',
75   - }
76   -
77   - rpmbuilder::mock::pl_config { 'pl-6-i386-dev.cfg':
78   - config => "${mock_path}/pl-6-i386-dev.cfg",
79   - build_root => 'pl-6-i386-dev',
80   - target_arch => 'i386',
81   - dist => 'el6',
82   - base_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=i386&repo=os',
83   - updates_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=i386&repo=updates',
84   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/6/products/i386',
85   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/6/dependencies/i386',
86   - epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=i386',
87   - failover_priority => 'base',
88   - }
89   -
90   - rpmbuilder::mock::pl_config { 'pl-6-x86_64.cfg':
91   - config => "${mock_path}/pl-6-x86_64.cfg",
92   - build_root => 'pl-6-x86_64',
93   - target_arch => 'x86_64',
94   - dist => 'el6',
95   - base_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os',
96   - updates_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=updates',
97   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/6/products/x86_64',
98   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/6/dependencies/x86_64',
99   - epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=x86_64',
100   - failover_priority => 'base',
101   - }
102   -
103   - rpmbuilder::mock::pl_config { 'pl-6-x86_64-dev.cfg':
104   - config => "${mock_path}/pl-6-x86_64-dev.cfg",
105   - build_root => 'pl-6-x86_64-dev',
106   - target_arch => 'x86_64',
107   - dist => 'el6',
108   - base_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os',
109   - updates_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=updates',
110   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/el/6/products/x86_64/',
111   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/el/6/dependencies/x86_64/',
112   - puppet_dev_baseurl => 'http://yum.puppetlabs.com/el/6/devel/x86_64/',
113   - epel_repo_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=x86_64',
114   - failover_priority => 'base',
115   - }
116   -
117   - rpmbuilder::mock::pl_config { 'pl-fc15-i386.cfg':
118   - config => "${mock_path}/pl-fc15-i386.cfg",
119   - build_root => 'pl-fc15-i386',
120   - target_arch => 'i686',
121   - dist => 'fc15',
122   - base_repo_baseurl => 'http://mirrors.cat.pdx.edu/fedora/linux/releases/15/Fedora/i386/os/',
123   - updates_repo_baseurl => 'http://mirrors.cat.pdx.edu/fedora/linux/updates/15/i386',
124   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f15/products/i386/',
125   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f15/dependencies/i386/',
126   - }
127   -
128   - rpmbuilder::mock::pl_config { 'pl-fc15-i386-dev.cfg':
129   - config => "${mock_path}/pl-fc15-i386-dev.cfg",
130   - build_root => 'pl-fc15-i386-dev',
131   - target_arch => 'i686',
132   - dist => 'fc15',
133   - base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-15&arch=i386',
134   - updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f15&arch=i386',
135   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f15/products/i386/',
136   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f15/dependencies/i386/',
137   - puppet_dev_baseurl => 'http://yum.puppetlabs.com/fedora/f15/devel/i386/',
138   - }
139   -
140   - rpmbuilder::mock::pl_config { 'pl-fc15-x86_64.cfg':
141   - config => "${mock_path}/pl-fc15-x86_64.cfg",
142   - build_root => 'pl-fc15-x86_64',
143   - target_arch => 'x86_64',
144   - dist => 'fc15',
145   - base_repo_baseurl => 'http://mirrors.cat.pdx.edu/fedora/linux/releases/15/Fedora/x86_64/os/',
146   - updates_repo_baseurl => 'http://mirrors.cat.pdx.edu/fedora/linux/updates/15/x86_64',
147   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f15/products/x86_64/',
148   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f15/dependencies/x86_64/',
149   - }
150   -
151   - rpmbuilder::mock::pl_config { 'pl-fc15-x86_64-dev.cfg':
152   - config => "${mock_path}/pl-fc15-x86_64-dev.cfg",
153   - build_root => 'pl-fc15-x86_64-dev',
154   - target_arch => 'x86_64',
155   - dist => 'fc15',
156   - base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-15&arch=x86_64',
157   - updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f15&arch=x86_64',
158   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f15/products/x86_64/',
159   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f15/dependencies/x86_64/',
160   - puppet_dev_baseurl => 'http://yum.puppetlabs.com/fedora/f15/devel/x86_64/',
161   - }
162   -
163   - rpmbuilder::mock::pl_config { 'pl-fc16-i386.cfg':
164   - config => "${mock_path}/pl-fc16-i386.cfg",
165   - build_root => 'pl-fc16-i386',
166   - target_arch => 'i386',
167   - dist => 'fc16',
168   - base_repo_baseurl => 'http://mirrors.cat.pdx.edu/fedora/linux/releases/16/Fedora/i386/os/',
169   - updates_repo_baseurl => 'http://mirrors.cat.pdx.edu/fedora/linux/updates/16/i386',
170   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f16/products/i386/',
171   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f16/dependencies/i386/',
172   - }
173   -
174   - rpmbuilder::mock::pl_config { 'pl-fc16-i386-dev.cfg':
175   - config => "${mock_path}/pl-fc16-i386-dev.cfg",
176   - build_root => 'pl-fc16-i386-dev',
177   - target_arch => 'x86_64',
178   - dist => 'i686',
179   - base_repo_baseurl => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-16&arch=i386',
180   - updates_repo_baseurl => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f16&arch=i386',
181   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f16/products/i386/',
182   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f16/dependencies/i386/',
183   - puppet_dev_baseurl => 'http://yum.puppetlabs.com/fedora/f16/devel/i386/',
184   - }
185   -
186   - rpmbuilder::mock::pl_config { 'pl-fc16-x86_64.cfg':
187   - config => "${mock_path}/pl-fc16-x86_64.cfg",
188   - build_root => 'pl-fc16-x86_64',
189   - target_arch => 'x86_64',
190   - dist => 'fc16',
191   - base_repo_baseurl => 'http://mirrors.cat.pdx.edu/fedora/linux/releases/16/Fedora/x86_64/os/',
192   - updates_repo_baseurl => 'http://mirrors.cat.pdx.edu/fedora/linux/updates/16/x86_64',
193   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f16/products/x86_64/',
194   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f16/dependencies/x86_64/',
195   - }
196   -
197   - rpmbuilder::mock::pl_config { 'pl-fc16-x86_64-dev.cfg':
198   - config => "${mock_path}/pl-fc16-x86_64-dev.cfg",
199   - build_root => 'pl-fc17-x86_64',
200   - target_arch => 'x86_64',
201   - dist => 'fc16',
202   - base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-16&arch=x86_64',
203   - updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f16&arch=x86_64',
204   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f16/products/x86_64/',
205   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f16/dependencies/x86_64/',
206   - puppet_dev_baseurl => 'http://yum.puppetlabs.com/fedora/f16/devel/x86_64/',
207   - }
208   -
209   - rpmbuilder::mock::pl_config { 'pl-fc17-i386.cfg':
210   - config => "${mock_path}/pl-fc17-i386.cfg",
211   - build_root => 'pl-fc17-i386',
212   - target_arch => 'i686',
213   - dist => 'fc17',
214   - base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-17&arch=i386',
215   - base_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-17&arch=i386',
216   - updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f17&arch=i386',
217   - updates_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f17&arch=i386',
218   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f17/products/i386/',
219   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f17/dependencies/i386/',
220   - }
221   -
222   - rpmbuilder::mock::pl_config { 'pl-fc17-i386-dev.cfg':
223   - config => "${mock_path}/pl-fc17-i386-dev.cfg",
224   - build_root => 'pl-fc17-i386-dev',
225   - target_arch => 'i686',
226   - dist => 'fc17',
227   - base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-17&arch=i386',
228   - base_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-17&arch=i386',
229   - updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f17&arch=i386',
230   - updates_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f17&arch=i386',
231   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f17/products/i386/',
232   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f17/dependencies/i386/',
233   - puppet_dev_baseurl => 'http://yum.puppetlabs.com/fedora/f17/devel/i386/',
234   - }
235   -
236   - rpmbuilder::mock::pl_config { 'pl-fc17-x86_64.cfg':
237   - config => "${mock_path}/pl-fc17-x86_64.cfg",
238   - build_root => 'pl-fc-17-x86_64',
239   - target_arch => 'x86_64',
240   - dist => 'fc17',
241   - base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-17&arch=x86_64',
242   - base_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-17&arch=x86_64',
243   - updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f17&arch=x86_64',
244   - updates_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f17&arch=x86_64',
245   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f17/products/x86_64/',
246   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f17/dependencies/x86_64/',
247   - }
248   -
249   - rpmbuilder::mock::pl_config { 'pl-fc17-x86_64-dev.cfg':
250   - config => "${mock_path}/pl-fc17-x86_64-dev.cfg",
251   - build_root => 'pl-fc17-x86_64-dev',
252   - target_arch => 'x86_64',
253   - dist => 'fc17',
254   - base_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-17&arch=x86_64',
255   - base_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-17&arch=i386',
256   - updates_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f17&arch=x86_64',
257   - updates_debug_mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f17&arch=i386',
258   - puppet_prod_baseurl => 'http://yum.puppetlabs.com/fedora/f17/products/x86_64/',
259   - puppet_deps_baseurl => 'http://yum.puppetlabs.com/fedora/f17/dependencies/x86_64/',
260   - puppet_dev_baseurl => 'http://yum.puppetlabs.com/fedora/f17/devel/x86_64/',
  1 +class rpmbuilder::mock::puppetlabs_mocks (
  2 + $fedora_releases = ["15","16","17"],
  3 + $el_releases = ["5","6"],
  4 + $vendor = undef,
  5 + $proxy = undef,
  6 + $mock_root = undef,
  7 +) {
  8 +
  9 + rpmbuilder::mock::pl_mocks { $fedora_releases:
  10 + dist => "fedora",
  11 + vendor => $vendor,
  12 + proxy => $proxy,
  13 + mock_root => $mock_root,
  14 + }
  15 +
  16 + rpmbuilder::mock::pl_mocks { $el_releases:
  17 + dist => "el",
  18 + vendor => $vendor,
  19 + proxy => $proxy,
  20 + mock_root => $mock_root,
261 21 }
262 22 }
263   -
12 manifests/packages/essential.pp
... ... @@ -1,4 +1,7 @@
1 1 class rpmbuilder::packages::essential {
  2 + Package {
  3 + require => Class['rpmbuilder::repos']
  4 + }
2 5
3 6 $builder_pkgs = [
4 7 'autoconf',
@@ -6,7 +9,7 @@
6 9 'createrepo',
7 10 'fedora-packager',
8 11 'gcc',
9   - 'gnupg',
  12 + 'gnupg2',
10 13 'make',
11 14 'mock',
12 15 'rpmdevtools',
@@ -20,14 +23,11 @@
20 23
21 24 package { $builder_pkgs:
22 25 ensure => installed,
23   - require => Class['rpmbuilder::repos'],
24 26 }
  27 +
25 28 case $operatingsystem {
26   - /(CentOS|RedHat)/: { }
27 29 'Fedora': {
28   - package { 'rpm-sign': ensure => installed }
29   - package { 'keychain': ensure => installed }
  30 + package { 'rpm-sign': ensure => installed }
30 31 }
31 32 }
32 33 }
33   -
2  manifests/repos.pp
@@ -18,7 +18,7 @@
18 18
19 19 if $::osfamily == 'RedHat' and $::operatingsystem != 'Fedora' {
20 20 include epel
21   - }
  21 + }
22 22
23 23 yumrepo { 'puppetlabs-products':
24 24 baseurl => "http://yum.puppetlabs.com/${baseurlOS}/${os_version}/products/${::architecture}",
9 spec/classes/packages_essential_spec.rb
@@ -10,7 +10,7 @@
10 10 'createrepo',
11 11 'fedora-packager',
12 12 'gcc',
13   - 'gnupg',
  13 + 'gnupg2',
14 14 'make',
15 15 'mock',
16 16 'rpmdevtools',
@@ -22,9 +22,8 @@
22 22 'yum-utils',]
23 23
24 24 packages.each do|pkg|
25   - it { should contain_package("#{pkg}").with_ensure('installed') }
  25 + it { should contain_package(pkg).with_ensure('installed') }
26 26 end
27   -
28 27 end
29 28
30 29 context "On a Fedora OS" do
@@ -32,10 +31,10 @@
32 31
33 32 packages = [
34 33 'rpm-sign',
35   - 'keychain',]
  34 + ]
36 35
37 36 packages.each do|pkg|
38   - it { should contain_package("#{pkg}").with_ensure('installed') }
  37 + it { should contain_package(pkg).with_ensure('installed') }
39 38 end
40 39 end
41 40 end
2  spec/classes/packages_extra_spec.rb
@@ -12,7 +12,7 @@
12 12 ]
13 13
14 14 packages.each do|pkg|
15   - it { should contain_package("#{pkg}").with_ensure('installed').with_require('Class[Rpmbuilder::Repos]') }
  15 + it { should contain_package(pkg).with_ensure('installed').with_require('Class[Rpmbuilder::Repos]') }
16 16 end
17 17 end
18 18 end
68 spec/classes/pe_mocks_spec.rb
@@ -2,43 +2,41 @@
2 2
3 3 describe 'rpmbuilder::mock::pe_mocks', :type => 'class' do
4 4
5   - context 'Each Puppet Labs Enterprise mock configuration file should be present' do
  5 + [{
  6 + :pe_vers => ["1.2","2.0","2.5","2.6","2.7"],
  7 + :mock_root => "/etc/mock",
  8 + },
  9 + {
  10 + :pe_vers => ["2.8","2.9"],
  11 + :mock_root => "/opt/mock",
  12 + }].each do |param_set|
  13 + describe "when #{param_set[:mock_root] == "/etc/mock" ? "using default params" : "specifying parameters"}" do
  14 + context 'Each Puppet Labs Enterprise mock configuration file should be present' do
6 15
7   - configs = [
8   - 'pupent-1.1-el4-i386-cve.cfg',
9   - 'pupent-1.1-el4-x86_64-cve.cfg',
10   - 'pupent-1.1-el5-i386-cve.cfg',
11   - 'pupent-1.1-el5-x86_64-cve.cfg',
12   - 'pupent-1.1-el6-i386-cve.cfg',
13   - 'pupent-1.1-el6-x86_64-cve.cfg',
14   - 'pupent-1.2-el4-i386-cve.cfg',
15   - 'pupent-1.2-el4-x86_64-cve.cfg',
16   - 'pupent-1.2-el5-i386-cve.cfg',
17   - 'pupent-1.2-el5-x86_64-cve.cfg',
18   - 'pupent-1.2-el6-i386-cve.cfg',
19   - 'pupent-1.2-el6-x86_64-cve.cfg',
20   - 'pupent-2.0-el4-i386-cve.cfg',
21   - 'pupent-2.0-el4-x86_64-cve.cfg',
22   - 'pupent-2.0-el5-i386-cve.cfg',
23   - 'pupent-2.0-el5-x86_64-cve.cfg',
24   - 'pupent-2.0-el6-i386-cve.cfg',
25   - 'pupent-2.0-el6-x86_64-cve.cfg',
26   - 'pupent-el4-i386.cfg',
27   - 'pupent-el4-x86_64.cfg',
28   - 'pupent-el5-i386.cfg',
29   - 'pupent-el5-x86_64.cfg',
30   - 'pupent-el6-i386.cfg',
31   - 'pupent-el6-x86_64.cfg',
32   - 'pupent-extras-el5-i386.cfg',
33   - 'pupent-extras-el5-x86_64.cfg',
34   - 'pupent-extras-el6-i386.cfg',
35   - 'pupent-extras-el6-x86_64.cfg',
36   - 'pupent-fc15-i386.cfg',
37   - 'pupent-fc15-x86_64.cfg'
38   - ]
  16 + let(:params) do
  17 + param_set
  18 + end
39 19
40   - configs.each do|config|
41   - it { should contain_Rpmbuilder__mock__Pe_config("#{config}") }
  20 + param_set[:pe_vers].each do | pe_mock |
  21 + it do should contain_Rpmbuilder__mock__pe_mockset(pe_mock).with({
  22 + :mock_root => param_set[:mock_root],
  23 + })
  24 + end
  25 + end
  26 +
  27 + [5,6].each do |rel|
  28 + ["i386","x86_64"].each do |arch|
  29 + describe "Should have an extras config for el#{rel.to_s}-#{arch}" do
  30 + it { should contain_Rpmbuilder__mock__Pe_Mock("pupent-extras-el#{rel.to_s}-#{arch}").with({
  31 + :pe_ver => "2.5",
  32 + :arch => arch,
  33 + :release => rel.to_s,
  34 + :mock_root => param_set[:mock_root],
  35 + })}
  36 + end
  37 + end
  38 + end
  39 + end
42 40 end
43 41 end
44 42 end
64 spec/classes/puppetlabs_mocks_spec.rb
... ... @@ -1,33 +1,49 @@
1 1 require 'spec_helper'
2 2
3 3 describe 'rpmbuilder::mock::puppetlabs_mocks', :type => 'class' do
  4 + [{},
  5 + { :vendor => "Puppet Labs" },
  6 + { :proxy => "http://proxy.puppetlabs.com:1234" },
  7 + { :fedora_releases => ["18"] },
  8 + { :el_releases => ["7"] },
  9 + ].each do |param_set|
  10 + describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do
  11 + default_params = {
  12 + :vendor => "Puppet User",
  13 + :proxy => nil,
  14 + :fedora_releases => ["15","16","17"],
  15 + :el_releases => ["5","6"],
  16 + }
4 17
5   - context 'Each Puppet Labs mock configuration file should be present' do
  18 + param_hash = default_params.merge(param_set)
6 19
7   - configs = [
8   - 'pl-5-i386.cfg',
9   - 'pl-5-i386-dev.cfg',
10   - 'pl-5-x86_64.cfg',
11   - 'pl-5-x86_64-dev.cfg',
12   - 'pl-6-i386.cfg',
13   - 'pl-6-i386-dev.cfg',
14   - 'pl-6-x86_64.cfg',
15   - 'pl-6-x86_64-dev.cfg',
16   - 'pl-fc15-i386.cfg',
17   - 'pl-fc15-x86_64.cfg',
18   - 'pl-fc15-x86_64-dev.cfg',
19   - 'pl-fc16-i386.cfg',
20   - 'pl-fc16-i386-dev.cfg',
21   - 'pl-fc16-x86_64.cfg',
22   - 'pl-fc17-i386.cfg',
23   - 'pl-fc17-i386-dev.cfg',
24   - 'pl-fc17-x86_64.cfg',
25   - 'pl-fc17-x86_64-dev.cfg'
26   - ]
  20 + let :params do
  21 + param_set
  22 + end
27 23
28   - configs.each do|config|
29   - it { should contain_Rpmbuilder__Mock__Pl_config("#{config}") }
  24 + context 'Each Puppet Labs mock configuration file should be present' do
  25 + param_hash[:fedora_releases].each do |fedora|
  26 + it do
  27 + should contain_Rpmbuilder__Mock__Pl_mocks(fedora).with(
  28 + {
  29 + :vendor => param_hash[:vendor],
  30 + :proxy => param_hash[:proxy],
  31 + :dist => "fedora",
  32 + })
  33 + end
  34 + end
  35 +
  36 + param_hash[:el_releases].each do |el|
  37 + it do
  38 + should contain_Rpmbuilder__Mock__Pl_mocks(el).with(
  39 + {
  40 + :vendor => param_hash[:vendor],
  41 + :proxy => param_hash[:proxy],
  42 + :dist => "el",
  43 + })
  44 + end
  45 + end
  46 + end
30 47 end
31 48 end
32 49 end
33   -
57 spec/classes/rpmbuilder_spec.rb
... ... @@ -1,19 +1,58 @@
1 1 require 'spec_helper'
2 2
3 3 describe 'rpmbuilder', :type => 'class' do
  4 + let(:default_params) do
  5 + {
  6 + :fedora_releases => nil,
  7 + :el_releases => nil,
  8 + :vendor => nil,
  9 + :mock_root => nil,
  10 + :proxy => nil,
  11 + :pe => false,
  12 + :pe_vers => nil,
  13 + }
  14 + end
4 15
5   - context "The minimum components that should be included" do
  16 + [{},
  17 + {
  18 + :fedora_releases => ["15","16","17"],
  19 + :el_releases => ["5","6"],
  20 + :vendor => "Puppet Labs",
  21 + :mock_root => "/usr/mock",
  22 + :proxy => "http://proxy.puppetlabs.com:1234",
  23 + :pe => true,
  24 + :pe_vers => ["1.2","lance"],
  25 + }].each do |param_set|
  26 + let(:param_hash) do
  27 + default_params.merge(param_set)
  28 + end
6 29
7   - it { should include_class("rpmbuilder::repos") }
8   - it { should include_class("rpmbuilder::packages::essential") }
  30 + let(:params) do
  31 + param_set
  32 + end
9 33
10   - end
  34 + describe "Using #{param_set == {} ? "default params" : "specifying params"}" do
  35 + it { should contain_Rpmbuilder__Repos }
  36 + it { should contain_Rpmbuilder__Packages__Essential }
11 37
12   - context "Extra components that may be included" do
  38 + it { should contain_Rpmbuilder__Mock__Puppetlabs_Mocks.with({
  39 + :fedora_releases => param_hash[:fedora_releases],
  40 + :el_releases => param_hash[:el_releases],
  41 + :vendor => param_hash[:vendor],
  42 + :mock_root => param_hash[:mock_root],
  43 + :proxy => param_hash[:proxy],
  44 + })
  45 + }
13 46
14   - let(:pre_condition) { 'class rpmbuilder::packages::extra {}' }
15   - let(:pre_condition) { 'class mock::puppetlabs_mocks {}' }
16   - it { should include_class("rpmbuilder::packages::extra") }
17   - it { should include_class("rpmbuilder::mock::puppetlabs_mocks") }
  47 + it do
  48 + if param_hash[:pe]
  49 + should contain_Rpmbuilder__Packages__Extra
  50 + should contain_Rpmbuilder__Mock__Pe_mocks.with({
  51 + :pe_vers => param_hash[:pe_vers],
  52