Skip to content

Commit

Permalink
Closes-Bug: #1621192
Browse files Browse the repository at this point in the history
Add the system resource settings that were present in fab and missing in SM

Change-Id: Iad9b1ee19033633aae07a3ecc9c86837ea46233d
  • Loading branch information
sgurumurthy committed Sep 15, 2016
1 parent 65a07af commit 89fc317
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
10 changes: 10 additions & 0 deletions contrail/environment/modules/contrail/manifests/common.pp
Expand Up @@ -145,4 +145,14 @@
}
contain ::contrail::flush_iptables
contain ::contrail::enable_kernel_core
if (("config" in $host_roles) or ("database" in $host_roles) or ("control" in $host_roles) or ("controller" in $host_roles)) {
contrail::lib::augeas_security_limits_conf_set {
"root-soft": title => "root-soft", domain => root, type => soft, item => nofile, value => 65535;
"root-hard": title => "root-hard", domain => root, type => hard, item => nofile, value => 65535;
"*-hard-nofile": title => "*-hard-nofile", domain => "*", type => hard, item => nofile, value => 65535;
"*-soft-nofile": title => "*-soft-nofile", domain => "*", type => soft, item => nofile, value => 65535;
"*-hard-nproc": title => "*-hard-nproc", domain => "*", type => hard, item => nproc, value => 65535;
"*-soft-nofile-2": title => "*-soft-nofile-2", domain => "*", type => soft, item => nofile, value => 65535;
}
}
}
@@ -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",
]
}

}
9 changes: 9 additions & 0 deletions contrail/environment/modules/contrail/manifests/rabbitmq.pp
Expand Up @@ -43,6 +43,15 @@
$amqp_name_list_shell = join($amqp_name_list, ",")
$rabbit_env = "NODE_IP_ADDRESS=${host_control_ip}\nNODENAME=rabbit@${::hostname}ctrl\n"

if ($::operatingsystem == 'Ubuntu') {
file {'/etc/default/rabbitmq-server':
ensure => present,
} ->
file_line { 'RABBITMQ-SERVER-ULIMIT':
path => '/etc/default/rabbitmq-server',
line => 'ulimit -n 10240',
} ~> Service['rabbitmq-server']
}
if !defined(Service['rabbitmq-server']) {
if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') {
$svc_en = false
Expand Down
Expand Up @@ -25,10 +25,28 @@
$contrail_logoutput = $::contrail::params::contrail_logoutput,
$contrail_host_roles = $::contrail::params::host_roles,
$enable_lbaas = $::contrail::params::enable_lbaas,
$enable_dpdk = $::contrail::params::enable_dpdk,
) inherits ::contrail::params {

#Determine vrouter package to be installed based on the kernel
#TODO add DPDK support here
if ($enable_dpdk) {
mount { '/hugepages':
ensure => absent,
} ->
contrail::lib::augeas_conf_rm { "max_map_count_value_removed":
key => 'vm.max_map_count',
config_file => '/etc/sysctl.conf',
lens_to_use => 'properties.lns',
} ->
file_line {'fstab_hugetlbfs':
ensure => absent,
path => '/etc/fstab',
line => 'hugetlbfs /hugepages hugetlbfs defaults,pagesize=1G 0 0',
match => '^*hugetlbfs.*hugetlbfs.*$',
match_for_absence => true,
}
}
if ($operatingsystem == 'Ubuntu'){

if ($lsbdistrelease == '14.04') {
Expand Down

0 comments on commit 89fc317

Please sign in to comment.