Add incomplete librenms role.

This commit is contained in:
Markus 2016-07-06 13:26:42 +02:00
parent b2ca65b0cc
commit 31b4b2e385
7 changed files with 82 additions and 0 deletions

1
group_vars/FreeBSD Normal file
View File

@ -0,0 +1 @@
pdns_config_dir: /usr/local/etc/pdns

1
group_vars/Ubuntu Normal file
View File

@ -0,0 +1 @@
pdns_config_dir: /etc/powerdns

View File

@ -14,6 +14,11 @@ ldap_base: dc=binary-kitchen,dc=de
ldap_binddn: cn=Services,ou=roles,dc=binary-kitchen,dc=de
ldap_bindpw: svcpwd
librenms_domain: librenms.binary.kitchen
librenms_dbname: librenms
librenms_dbuser: librenms
librenms_dbpass: xNUYsUhzwP4u7cVNCECz
mail_domain: binary-kitchen.de
mail_domains:
- ccc-r.de

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,48 @@
---
- name: Install dependencies
apt: name={{ item }} state=present
with_items:
- fping
- git
- graphviz
- imagemagick
- mtr-tiny
- mysql-server
- nmap
- php-net-ipv4
- php-net-ipv6
- php-pear
- php5-cli
- php5-curl
- php5-fpm
- php5-gd
- php5-json
- php5-mcrypt
- php5-mysql
- php5-snmp
- python-mysqldb
- rrdtool
- snmp
- snmpd
- whois
- name: Configure MySQL database
mysql_db: name={{ librenms_dbname }}
- name: Configure MySQL user
mysql_user: name={{ librenms_dbuser }} password={{ librenms_dbpass }} priv={{ librenms_dbname }}.*:ALL state=present
- name: Unpack librenms
unarchive: src=https://github.com/librenms/librenms/archive/201607.zip dest=/opt copy=no
- name: Configure vhost
template: src=vhost.j2 dest=/etc/nginx/sites-available/librenms
notify: Restart nginx
- name: Enable vhost
file: src=/etc/nginx/sites-available/librenms dest=/etc/nginx/sites-enabled/librenms 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 {{ librenms_domain }};
root /opt/librenms/wwwroot;
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;
}
}