1fe00b4019
CentOS7 comes with python2.7 included, so we need to update path to site-packages directory Blueprint: master-on-centos7 Compatible with CentOS6 & CentOS7 master node Change-Id: Ifa7026ef5e090d740797567e99dae0f08e41c310
62 lines
1.3 KiB
Puppet
62 lines
1.3 KiB
Puppet
# == Class: nailgun::uwsgi
|
|
#
|
|
#
|
|
#
|
|
# === Parameters
|
|
#
|
|
class nailgun::uwsgi(
|
|
$production,
|
|
$venv = '/usr',
|
|
) {
|
|
|
|
if $::osfamily == 'RedHat' {
|
|
case $operatingsystemmajrelease {
|
|
'6': {
|
|
$site_packages_path = inline_template("<%= @venv %>/lib/python2.6/site-packages")
|
|
}
|
|
'7': {
|
|
$site_packages_path = inline_template("<%= @venv %>/lib/python2.7/site-packages")
|
|
}
|
|
}
|
|
}
|
|
|
|
if $::physicalprocessorcount > 4 {
|
|
$physicalprocessorcount = 8
|
|
} else {
|
|
$physicalprocessorcount = $::physicalprocessorcount * 2
|
|
}
|
|
|
|
if $production == "docker-build" {
|
|
$somaxconn = "100"
|
|
} else {
|
|
#Increase max connections for sockets for Nailgun uWSGI
|
|
$somaxconn = "4096"
|
|
sysctl::value{'net.core.somaxconn': value => $somaxconn}
|
|
}
|
|
|
|
package { ['uwsgi', 'uwsgi-plugin-common', 'uwsgi-plugin-python']:
|
|
ensure => installed,
|
|
}
|
|
|
|
file { '/etc/nailgun/uwsgi_nailgun.yaml':
|
|
content => template('nailgun/uwsgi_nailgun.yaml.erb'),
|
|
ensure => present,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
require => Package['uwsgi'],
|
|
}
|
|
|
|
file { '/var/lib/nailgun-uwsgi':
|
|
ensure => present,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
}
|
|
Class[Nailgun::Venv]->
|
|
File['/etc/nailgun/uwsgi_nailgun.yaml']
|
|
|
|
Class[Nailgun::Venv]->
|
|
File['/var/lib/nailgun-uwsgi']
|
|
}
|