Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for using tmpfs in mock

  • Loading branch information...
commit 181488aafa5fefbebd06e1edb011634585ccdba8 1 parent adb7266
@shrug shrug authored
View
1  Modulefile
@@ -10,3 +10,4 @@ project_page 'https://github.com/Whopper92/puppetlabs-rpmbuilder'
## Add dependencies, if any:
dependency 'stahnma/epel', '>= 0.0.1'
dependency 'stahnma/puppetlabs_yum', '>= 0.1.0'
+dependency 'puppetlabs/inifile', '>= 1.0.0'
View
9 manifests/init.pp
@@ -8,6 +8,9 @@
$pe_vers = undef,
$add_pl_repos = true,
$use_extra_packages = false,
+ $use_tmpfs = false,
+ $tmpfs_req_ram = '4096',
+ $tmpfs_max_size = '2048m',
) {
Class['Rpmbuilder::Packages::Essential']->Class['Rpmbuilder::Mock::Puppetlabs_mocks']
@@ -36,4 +39,8 @@
mock_root => $mock_root,
}
}
-}
+
+ if $use_tmpfs {
+ include rpmbuilder::mock::tmpfs_plugin
+ }
+}
View
23 manifests/mock/tmpfs_plugin.pp
@@ -0,0 +1,23 @@
+class rpmbuilder::mock::tmpfs_plugin {
+ ini_setting { "Use tmpfs":
+ ensure => present,
+ path => '/etc/mock/site-defaults.cfg',
+ section => '',
+ setting => "config_opts['plugin_conf']['tmpfs_enable']",
+ value => 'True',
+ }
+ ini_setting { "tmpfs Required RAM":
+ ensure => present,
+ path => '/etc/mock/site-defaults.cfg',
+ section => '',
+ setting => "config_opts['plugin_conf']['tmpfs_opts']['required_ram_mb']",
+ value => $rpmbuilder::tmpfs_req_ram,
+ }
+ ini_setting { "tmpfs max FS size":
+ ensure => present,
+ path => '/etc/mock/site-defaults.cfg',
+ section => '',
+ setting => "config_opts['plugin_conf']['tmpfs_opts']['max_fs_size']",
+ value => "'${rpmbuilder::tmpfs_max_size}'",
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.