Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tom De Vylder
committed
Oct 26, 2011
0 parents
commit 908d506
Showing
6 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Class: ulimit::config | ||
# | ||
# | ||
class ulimit::config { | ||
file { | ||
$ulimit::params::ulimit_confdir: | ||
ensure => directory, | ||
recurse => true, | ||
purge => true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Class: ulimit | ||
# | ||
# This class installs ulimit | ||
# | ||
# Parameters: | ||
# | ||
# Actions: | ||
# - Install ulimit | ||
# | ||
# Requires: | ||
# | ||
# Sample Usage: | ||
# node host01 { | ||
# class { 'ulimit': } | ||
# | ||
# ulimit::rule { | ||
# 'foo1': | ||
# ensure => present, | ||
# ulimit_domain => 'domain', | ||
# ulimit_type => 'type', | ||
# ulimit_item => 'item', | ||
# ulimit_value => 'value', | ||
# 'foo2': | ||
# ensure => present, | ||
# ulimit_domain => 'domain', | ||
# ulimit_type => 'type', | ||
# ulimit_item => 'item', | ||
# ulimit_value => 'value', | ||
# } | ||
# } | ||
# | ||
class ulimit { | ||
class { 'ulimit::params': } | ||
class { 'ulimit::config': } | ||
|
||
Class['ulimit::params'] -> | ||
Class['ulimit::config'] | ||
|
||
# Define: rule | ||
# Parameters: | ||
# $ensure, $ulimit_domain, $ulimit_type, $ulimit_item, $ulimit_value | ||
# | ||
define rule ( $ensure, $ulimit_domain, $ulimit_type, $ulimit_item, $ulimit_value ) { | ||
case $ensure { | ||
'present': { | ||
file { | ||
"$ulimit::params::ulimit_confdir/${name}.conf": | ||
ensure => file, | ||
content => template ('ulimit/rule.conf.erb'); | ||
} | ||
} | ||
|
||
'absent': { | ||
file { | ||
"$ulimit::params::ulimit_confdir/${name}": | ||
ensure => absent; | ||
} | ||
} | ||
|
||
default: { | ||
fail 'No ensure value found for ulimit rule.' | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Class: ulimit::params | ||
# | ||
# | ||
class ulimit::params { | ||
$ulimit_name = 'ulimit' | ||
$ulimit_confdir = '/etc/security/limits.d' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# File managed by Puppet | ||
# | ||
|
||
# <domain> <type> <item> <value> | ||
# | ||
<%= ulimit_domain %> <%= ulimit_type %> <%= ulimit_item %> <%= ulimit_value %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ulimit |