This repository was archived by the owner on Jun 5, 2020. It is now read-only.
File tree 2 files changed +46
-2
lines changed
2 files changed +46
-2
lines changed Original file line number Diff line number Diff line change 11
11
$use_tmpfs = false ,
12
12
$tmpfs_req_ram = ' 4096' ,
13
13
$tmpfs_max_size = ' 2048m' ,
14
+ $cleanup_on_failure = true ,
15
+ $cleanup_on_success = true ,
14
16
) {
15
17
16
18
Class[' Rpmbuilder::Packages::Essential' ]->Class[' Rpmbuilder::Mock::Puppetlabs_mocks' ]
39
41
mock_root => $mock_root ,
40
42
}
41
43
}
42
-
44
+
43
45
if $use_tmpfs {
44
46
include rpmbuilder::mock::tmpfs_plugin
45
47
}
46
- }
48
+
49
+ class { rpmbuilder::mock::cleanup:
50
+ on_success => $cleanup_on_success ,
51
+ on_failure => $cleanup_on_failure ,
52
+ }
53
+ }
Original file line number Diff line number Diff line change
1
+ class rpmbuilder::mock::cleanup (
2
+ $on_success = true ,
3
+ $on_failure = true ,
4
+ ) {
5
+
6
+
7
+ # Python is awesome, in that it's true and false boolean
8
+ # values are Camel-cased: True and False. Subsequently,
9
+ # any values you pass in to a boolean configuration options
10
+ # must respect the aforementioned camel-casing. Might be worth
11
+ # adding a camel method for strings into stdlib?
12
+ $failure = $on_failure ? {
13
+ /(?i:false )/ => ' False' ,
14
+ /(?i:true )/ => ' True' ,
15
+ }
16
+
17
+ $success = $on_success ? {
18
+ /(?i:false )/ => ' False' ,
19
+ /(?i:true )/ => ' True' ,
20
+ }
21
+
22
+ ini_setting { "Cleanup on success" :
23
+ ensure => present ,
24
+ path => ' /etc/mock/site-defaults.cfg' ,
25
+ section => ' ' ,
26
+ setting => " config_opts['cleanup_on_success']" ,
27
+ value => $cleanup_on_success ,
28
+ }
29
+
30
+ ini_setting { "Cleanup on failure" :
31
+ ensure => present ,
32
+ path => ' /etc/mock/site-defaults.cfg' ,
33
+ section => ' ' ,
34
+ setting => " config_opts['cleanup_on_failure']" ,
35
+ value => $cleanup_on_failure ,
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments