diff --git a/group_vars/all b/group_vars/all index 16a8384..02b2307 100644 --- a/group_vars/all +++ b/group_vars/all @@ -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 diff --git a/roles/racktables/handlers/main.yml b/roles/racktables/handlers/main.yml new file mode 100644 index 0000000..44975c4 --- /dev/null +++ b/roles/racktables/handlers/main.yml @@ -0,0 +1,4 @@ +--- + +- name: Restart nginx + service: name=nginx state=restarted diff --git a/roles/racktables/meta/main.yml b/roles/racktables/meta/main.yml new file mode 100644 index 0000000..34de459 --- /dev/null +++ b/roles/racktables/meta/main.yml @@ -0,0 +1,4 @@ +--- + +dependencies: +- { role: nginx, nginx_ssl: False } diff --git a/roles/racktables/tasks/main.yml b/roles/racktables/tasks/main.yml new file mode 100644 index 0000000..7dab177 --- /dev/null +++ b/roles/racktables/tasks/main.yml @@ -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 diff --git a/roles/racktables/templates/vhost.j2 b/roles/racktables/templates/vhost.j2 new file mode 100644 index 0000000..793cc43 --- /dev/null +++ b/roles/racktables/templates/vhost.j2 @@ -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; + } +} diff --git a/site.yml b/site.yml index 73884ef..54638f4 100644 --- a/site.yml +++ b/site.yml @@ -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: