forked from infra/ansible
Add incomplete librenms role.
This commit is contained in:
parent
b2ca65b0cc
commit
31b4b2e385
1
group_vars/FreeBSD
Normal file
1
group_vars/FreeBSD
Normal file
@ -0,0 +1 @@
|
|||||||
|
pdns_config_dir: /usr/local/etc/pdns
|
1
group_vars/Ubuntu
Normal file
1
group_vars/Ubuntu
Normal file
@ -0,0 +1 @@
|
|||||||
|
pdns_config_dir: /etc/powerdns
|
@ -14,6 +14,11 @@ ldap_base: dc=binary-kitchen,dc=de
|
|||||||
ldap_binddn: cn=Services,ou=roles,dc=binary-kitchen,dc=de
|
ldap_binddn: cn=Services,ou=roles,dc=binary-kitchen,dc=de
|
||||||
ldap_bindpw: svcpwd
|
ldap_bindpw: svcpwd
|
||||||
|
|
||||||
|
librenms_domain: librenms.binary.kitchen
|
||||||
|
librenms_dbname: librenms
|
||||||
|
librenms_dbuser: librenms
|
||||||
|
librenms_dbpass: xNUYsUhzwP4u7cVNCECz
|
||||||
|
|
||||||
mail_domain: binary-kitchen.de
|
mail_domain: binary-kitchen.de
|
||||||
mail_domains:
|
mail_domains:
|
||||||
- ccc-r.de
|
- ccc-r.de
|
||||||
|
4
roles/librenms/handlers/main.yml
Normal file
4
roles/librenms/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Restart nginx
|
||||||
|
service: name=nginx state=restarted
|
4
roles/librenms/meta/main.yml
Normal file
4
roles/librenms/meta/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- { role: nginx, nginx_ssl: False }
|
48
roles/librenms/tasks/main.yml
Normal file
48
roles/librenms/tasks/main.yml
Normal 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
|
19
roles/librenms/templates/vhost.j2
Normal file
19
roles/librenms/templates/vhost.j2
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user