Add racktables role (unfinished) and apply it.

This commit is contained in:
Markus 2016-06-18 13:23:12 +02:00
parent b83b2f02f1
commit 5bb3a44c71
6 changed files with 67 additions and 0 deletions

View File

@ -46,6 +46,11 @@ owncloud_dbpass: tnEykTqtsC9pECz7wAUJ
prosody_admin: moepman@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:
- 172.23.2.5
- 172.23.2.6

View File

@ -0,0 +1,4 @@
---
- name: Restart nginx
service: name=nginx state=restarted

View File

@ -0,0 +1,4 @@
---
dependencies:
- { role: nginx, nginx_ssl: False }

View 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

View 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;
}
}

View File

@ -6,6 +6,11 @@
- common
- ntp
- name: Setup monitoring server
hosts: nabia.binary.kitchen
roles:
- racktables
- name: Setup ldap server
hosts: helium.binary-kitchen.net
roles: