Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the system resource settings that were present in fab and missing in SM Change-Id: Iad9b1ee19033633aae07a3ecc9c86837ea46233d
- Loading branch information
1 parent
65a07af
commit 89fc317
Showing
4 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
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
32 changes: 32 additions & 0 deletions
32
contrail/environment/modules/contrail/manifests/lib/augeas_security_limits_conf_set.pp
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,32 @@ | ||
define contrail::lib::augeas_security_limits_conf_set ( | ||
$title = "default_title", | ||
$domain = "root", | ||
$type = "soft", | ||
$item = "nofile", | ||
$value = "10000" | ||
) { | ||
|
||
# guid of this entry | ||
$key = "$domain/$type/$item" | ||
|
||
$context = "/files/etc/security/limits.conf" | ||
|
||
$path_list = "domain[.=\"$domain\"][./type=\"$type\" and ./item=\"$item\"]" | ||
$path_exact = "domain[.=\"$domain\"][./type=\"$type\" and ./item=\"$item\" and ./value=\"$value\"]" | ||
|
||
augeas { "limits_conf/${title}": | ||
context => "$context", | ||
onlyif => "match $path_exact size != 1", | ||
changes => [ | ||
# remove all matching to the $domain, $type, $item, for any $value | ||
"rm $path_list", | ||
# insert new node at the end of tree | ||
"set domain[last()+1] $domain", | ||
# assign values to the new node | ||
"set domain[last()]/type $type", | ||
"set domain[last()]/item $item", | ||
"set domain[last()]/value $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
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