2016-06-18 13:23:12 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
apt: name={{ item }} state=present
|
|
|
|
with_items:
|
|
|
|
- mysql-server
|
|
|
|
- php5-fpm
|
|
|
|
- php5-gd
|
2016-06-18 14:44:59 +02:00
|
|
|
- php5-ldap
|
2016-06-18 13:23:12 +02:00
|
|
|
- php5-mysql
|
2016-06-18 14:44:59 +02:00
|
|
|
- php5-snmp
|
2016-06-18 13:23:12 +02:00
|
|
|
- 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
|
|
|
|
|
2016-06-18 14:44:59 +02:00
|
|
|
- name: Unpack RackTables
|
|
|
|
unarchive: src=http://heanet.dl.sourceforge.net/project/racktables/RackTables-0.20.11.tar.gz dest=/opt copy=no
|
|
|
|
|
|
|
|
- name: Create link
|
|
|
|
file: src=/opt/RackTables-0.20.11 dest=/opt/racktables state=link
|
|
|
|
|
|
|
|
- name: Configure RackTables
|
|
|
|
template: src=secret.php.j2 dest=/opt/RackTables-0.20.11/wwwroot/inc/secret.php owner=www-data group=www-data mode=0400
|
|
|
|
|
2016-06-18 13:23:12 +02:00
|
|
|
- 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
|