summaryrefslogtreecommitdiff
path: root/roles/subdap/templates
diff options
context:
space:
mode:
authorChristian Franke <nobody@nowhere.ws>2015-08-25 19:23:43 +0200
committerChristian Franke <nobody@nowhere.ws>2015-08-25 19:23:43 +0200
commitaf66612e6014bea48458125cda72d73c51bc3c20 (patch)
tree49cee76d579149a9fd800225303ee31be79cf3eb /roles/subdap/templates
Initial commit
Diffstat (limited to 'roles/subdap/templates')
-rw-r--r--roles/subdap/templates/accountservice.py.j24
-rw-r--r--roles/subdap/templates/subdap.service.j224
2 files changed, 28 insertions, 0 deletions
diff --git a/roles/subdap/templates/accountservice.py.j2 b/roles/subdap/templates/accountservice.py.j2
new file mode 100644
index 0000000..2f6e8f1
--- /dev/null
+++ b/roles/subdap/templates/accountservice.py.j2
@@ -0,0 +1,4 @@
+import xmlrpclib
+
+url = '{{ subdap_accountservice_url }}'
+accountservice = xmlrpclib.ServerProxy(url)
diff --git a/roles/subdap/templates/subdap.service.j2 b/roles/subdap/templates/subdap.service.j2
new file mode 100644
index 0000000..068570d
--- /dev/null
+++ b/roles/subdap/templates/subdap.service.j2
@@ -0,0 +1,24 @@
+[Unit]
+Description=subdap ldap frontend application server
+After=network.target
+
+[Service]
+PIDFile=/var/subdap/gunicorn.pid
+User=subdap
+Group=subdap
+WorkingDirectory=/var/subdap/src
+Environment=VIRTUAL_ENV="/var/subdap/venv"
+Environment=PATH="$VIRTUAL_ENV/bin:$PATH"
+ExecStart=/var/subdap/venv/bin/gunicorn \
+ --pid /var/subdap/gunicorn.pid \
+ --log-syslog \
+ --max-requests 1000 \
+ -w 10 -t 120 \
+ -b 127.0.0.1:8001 \
+ index
+ExecReload=/bin/kill -HUP $MAINPID
+ExecStop=/bin/kill -TERM $MAINPID
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target