Add racktables role (unfinished) and apply it.
This commit is contained in:
parent
b83b2f02f1
commit
5bb3a44c71
@ -46,6 +46,11 @@ owncloud_dbpass: tnEykTqtsC9pECz7wAUJ
|
|||||||
prosody_admin: moepman@jabber.binary-kitchen.de
|
prosody_admin: moepman@jabber.binary-kitchen.de
|
||||||
prosody_domain: jabber.binary-kitchen.de
|
prosody_domain: jabber.binary-kitchen.de
|
||||||
|
|
||||||
|
racktables_domain: racktables.binary.kitchen
|
||||||
|
racktables_dbname: racktables
|
||||||
|
racktables_dbuser: racktables
|
||||||
|
racktables_dbpass: chee6iechuz1EghuheiD
|
||||||
|
|
||||||
snmp_allowed:
|
snmp_allowed:
|
||||||
- 172.23.2.5
|
- 172.23.2.5
|
||||||
- 172.23.2.6
|
- 172.23.2.6
|
||||||
|
4
roles/racktables/handlers/main.yml
Normal file
4
roles/racktables/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Restart nginx
|
||||||
|
service: name=nginx state=restarted
|
4
roles/racktables/meta/main.yml
Normal file
4
roles/racktables/meta/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- { role: nginx, nginx_ssl: False }
|
30
roles/racktables/tasks/main.yml
Normal file
30
roles/racktables/tasks/main.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
apt: name={{ item }} state=present
|
||||||
|
with_items:
|
||||||
|
- mysql-server
|
||||||
|
- php5-fpm
|
||||||
|
- php5-gd
|
||||||
|
- php5-mysql
|
||||||
|
- python-mysqldb
|
||||||
|
|
||||||
|
- name: Configure MySQL database
|
||||||
|
mysql_db: name={{ racktables_dbname }}
|
||||||
|
|
||||||
|
- name: Configure MySQL user
|
||||||
|
mysql_user: name={{ racktables_dbuser }} password={{ racktables_dbpass }} priv={{ racktables_dbname }}.*:ALL state=present
|
||||||
|
|
||||||
|
- name: Create vhost directory
|
||||||
|
file: path=/var/www/racktables state=directory owner=www-data group=www-data
|
||||||
|
|
||||||
|
- name: Configure vhost
|
||||||
|
template: src=vhost.j2 dest=/etc/nginx/sites-available/racktables
|
||||||
|
notify: Restart nginx
|
||||||
|
|
||||||
|
- name: Enable vhost
|
||||||
|
file: src=/etc/nginx/sites-available/racktables dest=/etc/nginx/sites-enabled/racktables state=link
|
||||||
|
notify: Restart nginx
|
||||||
|
|
||||||
|
- name: Start php5-fpm
|
||||||
|
service: name=php5-fpm state=started enabled=yes
|
19
roles/racktables/templates/vhost.j2
Normal file
19
roles/racktables/templates/vhost.j2
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
|
||||||
|
server_name {{ racktables_domain }};
|
||||||
|
|
||||||
|
root /var/www/racktables;
|
||||||
|
|
||||||
|
index index.php;
|
||||||
|
|
||||||
|
location ~ \.php(?:$|/) {
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||||
|
fastcgi_intercept_errors on;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user