Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
mirror
chef-ulimit
Commits
1cb0b87d
Commit
1cb0b87d
authored
Jun 23, 2020
by
Jaymz Julian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge upstream
parent
6451fc6a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
62 deletions
+1
-62
libraries/user.rb
libraries/user.rb
+0
-62
resources/user.rb
resources/user.rb
+1
-0
No files found.
libraries/user.rb
deleted
100644 → 0
View file @
6451fc6a
require
'chef/resource'
class
Chef
class
Resource
class
UlimitUser
<
Chef
::
Resource
provides
:user_ulimit
property
:username
,
String
,
name_property:
true
property
:filename
,
String
,
default:
lazy
{
|
r
|
r
.
username
==
'*'
?
'00_all_limits'
:
"
#{
r
.
username
}
_limits"
}
property
:filehandle_limit
,
[
String
,
Integer
]
property
:filehandle_soft_limit
,
[
String
,
Integer
]
property
:filehandle_hard_limit
,
[
String
,
Integer
]
property
:process_limit
,
[
String
,
Integer
]
property
:process_soft_limit
,
[
String
,
Integer
]
property
:process_hard_limit
,
[
String
,
Integer
]
property
:memory_limit
,
[
String
,
Integer
]
property
:core_limit
,
[
String
,
Integer
]
property
:core_soft_limit
,
[
String
,
Integer
]
property
:core_hard_limit
,
[
String
,
Integer
]
property
:stack_limit
,
[
String
,
Integer
]
property
:stack_soft_limit
,
[
String
,
Integer
]
property
:stack_hard_limit
,
[
String
,
Integer
]
property
:rtprio_limit
,
[
String
,
Integer
]
property
:rtprio_soft_limit
,
[
String
,
Integer
]
property
:rtprio_hard_limit
,
[
String
,
Integer
]
action
:create
do
new_resource
.
filename
=
"
#{
new_resource
.
filename
}
.conf"
unless
new_resource
.
filename
.
include?
(
'.conf'
)
template
"/etc/security/limits.d/
#{
new_resource
.
filename
}
"
do
source
'ulimit.erb'
cookbook
'ulimit'
mode
'0644'
variables
(
ulimit_user:
new_resource
.
username
,
filehandle_limit:
new_resource
.
filehandle_limit
,
filehandle_soft_limit:
new_resource
.
filehandle_soft_limit
,
filehandle_hard_limit:
new_resource
.
filehandle_hard_limit
,
process_limit:
new_resource
.
process_limit
,
process_soft_limit:
new_resource
.
process_soft_limit
,
process_hard_limit:
new_resource
.
process_hard_limit
,
memory_limit:
new_resource
.
memory_limit
,
core_limit:
new_resource
.
core_limit
,
core_soft_limit:
new_resource
.
core_soft_limit
,
core_hard_limit:
new_resource
.
core_hard_limit
,
stack_limit:
new_resource
.
stack_limit
,
stack_soft_limit:
new_resource
.
stack_soft_limit
,
stack_hard_limit:
new_resource
.
stack_hard_limit
,
rtprio_limit:
new_resource
.
rtprio_limit
,
rtprio_soft_limit:
new_resource
.
rtprio_soft_limit
,
rtprio_hard_limit:
new_resource
.
rtprio_hard_limit
)
end
end
action
:delete
do
file
"/etc/security/limits.d/
#{
new_resource
.
filename
}
"
do
action
:delete
end
end
end
end
end
resources/user.rb
View file @
1cb0b87d
resource_name
:user_ulimit
provides
:user_ulimit
property
:username
,
String
,
name_property:
true
property
:filehandle_limit
,
[
String
,
Integer
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment