1
0
forked from infra/ansible
infra/roles/racktables/tasks/main.yml

40 lines
1.2 KiB
YAML

---
- name: Install dependencies
apt: name={{ item }}
with_items:
- mysql-server
- php7.0-fpm
- php7.0-gd
- php7.0-ldap
- php7.0-mbstring
- php7.0-mysql
- php7.0-snmp
- 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: Unpack RackTables
unarchive: src=http://heanet.dl.sourceforge.net/project/racktables/RackTables-0.20.11.tar.gz dest=/opt creates=/opt/RackTables-0.20.11/README remote_src=yes
- 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/wwwroot/inc/secret.php owner=www-data group=www-data mode=0400
- 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 php7.0-fpm
service: name=php7.0-fpm state=started enabled=yes