Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

.

  • Loading branch information...
commit cd8790e4647b33d58dac76b3f0e782bad345a6fa 1 parent 4d1d7a0
@specialunderwear authored
View
36 manifests/app.pp
@@ -1,30 +1,22 @@
define uwsgi::app (
- $socket,
- $ensure = 'present',
- $processes = $::processorcount,
- $master = true,
- $plugins = '',
- $rack = false,
- $postbuffering = false,
- $uid = 'www-data',
- $gid = 'www-data',
- $touchreload = '/tmp/reload.txt',
+ $socket='/var/run/uwsgi.sock',
+ $logto='/var/log/uwsgi.log'
+ $touchreload="/var/run/uwsgi-reload-${title}",
+ $processes=$::processorcount,
) {
- if $plugins {
- if $rack {
- package { $uwsgi::params::rack_plugin:
- ensure => installed,
- require => File[$rack],
- notify => Class['uwsgi::service'],
- }
- }
- }
-
file { "${uwsgi::params::configdir}/${name}.ini":
- ensure => $ensure,
+ ensure => 'file',
+ overwrite => true,
mode => '0644',
- content => template('uwsgi/app.ini'),
+ content => template('uwsgi/wsgi.xml.erb'),
notify => Class['uwsgi::service'],
}
+
+ # you can reload an app with reloading uwsgi itself
+ exec {"uwsgi-reload-${title}":
+ path => ['/usr/bin'],
+ command => "touch ${touchreload}",
+ refreshonly => true
+ }
}
View
12 manifests/init.pp
@@ -1,6 +1,6 @@
-class uwsgi {
- include uwsgi::params
- include uwsgi::install
- include uwsgi::service
-}
-
+class uwsgi($version='latest') {
+ class {"uwsgi::install":
+ $version => $version,
+ } ->
+ class {"uwsgi::service":}
+}
View
14 manifests/install.pp
@@ -1,11 +1,5 @@
-class uwsgi::install {
- package { $uwsgi::params::package:
- ensure => installed
+class uwsgi::install($version) {
+ package { "uwsgi":
+ ensure => $version
}
-
- if $uwsgi::params::plugins {
- package { $uwsgi::params::plugins_package:
- ensure => installed
- }
- }
-}
+}
View
1  manifests/params.pp
@@ -4,7 +4,6 @@
Debian,Ubuntu: {
$configdir = '/etc/uwsgi/apps-enabled'
$package = ['uwsgi']
- $rack_plugin = ['uwsgi-plugin-rack-ruby1.8','rubygems','ruby-rack']
}
default: {
notify { "${module_name}_unsupported":
View
1  manifests/service.pp
@@ -4,5 +4,6 @@
enable => true,
hasrestart => true,
hasstatus => false,
+ refreshonly => true
}
}
View
19 templates/app.ini
@@ -1,19 +0,0 @@
-[uwsgi]
- socket = <%= socket %>
-<% if master -%>
- master = true
-<% end -%>
- processes = <%= processes %>
-<% plugins.each do |plug| -%>
-<% if plug == "rack" -%>
- plugins = rack
- rack = <%= rack %>
-<% end -%>
-<% end -%>
-<% if postbuffering -%>
- post-buffering = <%= postbuffering %>
-<% end -%>
- uid = <%= uid %>
- gid = <%= gid %>
- touch-reload = <%= touchreload %>
-
View
26 templates/wsgi.xml.erb
@@ -0,0 +1,26 @@
+<uwsgi>
+ <socket>${buildout:directory}/var/run/avira/uwsgi_auth.sock</socket>
+ <chmod-socket>660</chmod-socket>
+ <touch-reload>${buildout:directory}/var/run/avira/reload_auth</touch-reload>
+ <cpu-affinity>1</cpu-affinity>
+ <log-rsyslog />
+ <disable-logging />
+ <logto>${buildout:directory}/var/log/avira/auth.log</logto>
+ <log-master />
+ <log-reopen />
+ <log-4xx />
+ <log-5xx />
+ <log-date />
+ <log-zero />
+ <master />
+ <lazy />
+ <no-orphans />
+ <processes>3</processes>
+ <reload-mercy>30</reload-mercy>
+ <single-interpreter />
+ <procname-prefix-spaced>apc-auth</procname-prefix-spaced>
+ <listen>65535</listen>
+ <env>AVIRA_CONFIG_PATH=${buildout:directory}/etc/avira/auth</env>
+ <module>apc.auth.wsgi</module>
+ <callable>app</callable>
+</uwsgi>
Please sign in to comment.
Something went wrong with that request. Please try again.