Browse Source

add newebe playbooks and config files/templates

Gelnior 10 years ago
parent
commit
5a30943955

+ 7
- 0
roles/newebe/files/config.yaml View File

@@ -0,0 +1,7 @@
1
+main:
2
+    port: 8282
3
+    debug: False
4
+    ssl: False
5
+    path: "/usr/local/var/newebe/"
6
+    logpath: "/usr/local/var/log/newebe"
7
+    timezone: "Europe/Paris"

+ 5
- 0
roles/newebe/files/newebe.conf View File

@@ -0,0 +1,5 @@
1
+[program:newebe]
2
+autorestart=false
3
+command=newebe_server.py --configfile=/usr/local/etc/newebe/config.yaml
4
+redirect_stderr=true
5
+user=newebe

+ 7
- 0
roles/newebe/files/supervisor.conf View File

@@ -0,0 +1,7 @@
1
+; supervisor config file
2
+
3
+[supervisord]
4
+nodaemon=true
5
+
6
+[include]
7
+files = /etc/supervisor/conf.d/*.conf

+ 0
- 0
roles/newebe/handlers/main.yml View File


+ 72
- 0
roles/newebe/tasks/main.yml View File

@@ -0,0 +1,72 @@
1
+- name: Install Python
2
+  apt: pkg=python,python-setuptools,python-pip,python-dev
3
+
4
+- name: Install Python tools
5
+  apt: pkg=python-imaging,python-pycurl
6
+
7
+- name: Install build tools
8
+  apt: pkg=build-essential,git
9
+
10
+- name: Install Python libs
11
+  apt: pkg=libxml2-dev,libxslt-dev,python-imaging
12
+
13
+- name: Install Supervisor
14
+  apt: pkg=supervisor
15
+
16
+- name: Install CouchDB
17
+  apt: pkg=couchdb
18
+
19
+- name: Install Newebe
20
+  pip: name='git+https://github.com/gelnior/newebe.git#egg=newebe'
21
+
22
+- name: Add group Newebe
23
+  group: name=newebe
24
+
25
+- name: Add user Newebe
26
+  user: name=newebe shell=/bin/bash groups=newebe
27
+
28
+- name: Create Newebe Config folder
29
+  file: path=/usr/local/etc/newebe/ owner=newebe group=newebe state=directory
30
+
31
+- name: Create Newebe folder
32
+  file: path=/usr/local/var/newebe/ owner=newebe group=newebe state=directory
33
+
34
+- name: Create Newebe log folder
35
+  file: path=/usr/local/var/log/newebe/ owner=newebe group=newebe state=directory
36
+
37
+- name: Set Newebe config file
38
+  copy: src=config.yaml dest=/usr/local/etc/newebe/config.yaml owner=newebe group=newebe
39
+
40
+- name: Set Supervisor config file
41
+  copy: src=newebe.conf dest=/etc/supervisor/conf.d/newebe.conf
42
+
43
+- name: Set Newebe Supervisor config file
44
+  copy: src=supervisor.conf dest=/etc/supervisor/supervisor.conf
45
+
46
+- name: Reload Supervisor and start Newebe
47
+  command: /usr/bin/supervisorctl update
48
+
49
+- name: Ensure that newebe is started
50
+  supervisorctl: name=newebe state=started
51
+
52
+- name: Add mod_proxy module to Apache
53
+  raw: a2enmod proxy
54
+# When Ansible 1.6 will be available  
55
+# apache2_module: state=present name=proxy
56
+
57
+- name: Add proxy_http module to Apache
58
+  raw: a2enmod proxy_http
59
+# When Ansible 1.6 will be available  
60
+# apache2_module: state=present name=proxy_http
61
+#
62
+- name: Configure the Apache HTTP server for Newebe
63
+  template: src=etc_apache2_sites-available_newebe.j2
64
+            dest=/etc/apache2/sites-available/newebe
65
+            group=www-data
66
+            owner=www-data
67
+  notify: restart apache
68
+
69
+- name: Enable the site
70
+  command: a2ensite newebe
71
+           creates=/etc/apache2/sites-enabled/newebe
72
+  notify: restart apache

+ 27
- 0
roles/newebe/templates/etc_apache2_sites-available_newebe.j2 View File

@@ -0,0 +1,27 @@
1
+<VirtualHost *:80>
2
+    ServerName {{ newebe_domain }}
3
+
4
+    Redirect permanent / https://{{ newebe_domain }}/
5
+</VirtualHost>
6
+
7
+<VirtualHost *:443>
8
+
9
+    ServerName {{ newebe_domain }}
10
+    SSLEngine On
11
+
12
+    SSLProtocol ALL -SSLv2
13
+    SSLHonorCipherOrder On
14
+    SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS
15
+    SSLCertificateFile /etc/ssl/certs/wildcard_public_cert.crt
16
+    SSLCertificateKeyFile /etc/ssl/private/wildcard_private.key
17
+    SSLCACertificateFile /etc/ssl/certs/wildcard_ca.pem
18
+    Header add Strict-Transport-Security "max-age=15768000; includeSubdomains"
19
+
20
+    ErrorLog /var/log/apache2/newebe.info-error_log
21
+    CustomLog /var/log/apache2/newebe.info-access_log common
22
+
23
+
24
+    ProxyPass / http://127.0.0.1:8282/
25
+    ProxyPassReverse / http://127.0.0.1:8282/
26
+
27
+</VirtualHost>

Loading…
Cancel
Save