diff --git a/roles/librenms/tasks/main.yml b/roles/librenms/tasks/main.yml index 934a0c7..087ad8a 100644 --- a/roles/librenms/tasks/main.yml +++ b/roles/librenms/tasks/main.yml @@ -33,23 +33,20 @@ - name: Configure MySQL user mysql_user: name={{ librenms_dbuser }} password={{ librenms_dbpass }} priv={{ librenms_dbname }}.*:ALL state=present - - name: Ensure librenms user exists - user: name=librenms createhome=no groups=www-data home=/opt/librenms system=yes + user: name=librenms groups=www-data createhome=no home=/usr/share/librenms system=yes - name: Clone librenms - git: repo=https://github.com/librenms/librenms.git dest=/opt/librenms depth=1 update=no - become: yes - become_user: librenms + git: repo=https://github.com/librenms/librenms.git dest=/usr/share/librenms depth=1 update=no - name: Ensure rrd directory exists - file: path=/opt/librenms/rrd owner=librenms group=librenms mode=0775 state=directory + file: path=/var/lib/librenms/rrd owner=librenms group=librenms mode=0775 state=directory -- name: Ensure logs directory exists - file: path=/opt/librenms/logs owner=librenms group=librenms mode=0775 state=directory +- name: Ensure rrd link exists + file: src=/var/lib/librenms/rrd dest=/usr/share/librenms/rrd state=link - name: Configure librenms - template: src=config.php.j2 dest=/opt/librenms/config.php owner=librenms group=librenms mode=0440 + template: src=config.php.j2 dest=/usr/share/librenms/config.php owner=librenms group=www-data mode=0440 - name: Configure vhost template: src=vhost.j2 dest=/etc/nginx/sites-available/librenms diff --git a/roles/librenms/templates/config.php.j2 b/roles/librenms/templates/config.php.j2 index 3977301..fa8194b 100644 --- a/roles/librenms/templates/config.php.j2 +++ b/roles/librenms/templates/config.php.j2 @@ -6,7 +6,7 @@ $config['db_host'] = 'localhost'; $config['db_user'] = '{{ librenms_dbuser }}'; $config['db_pass'] = '{{ librenms_dbpass }}'; $config['db_name'] = '{{ librenms_dbname }}'; -$config['db']['extension'] = "mysqli";// mysql or mysqli +$config['db']['extension'] = "mysql";// mysql or mysqli // This is the user LibreNMS will run as //Please ensure this user is created and has the correct permissions to your install @@ -18,7 +18,7 @@ $config['memcached']['host'] = "localhost"; $config['memcached']['port'] = 11211; ### Locations - it is recommended to keep the default -$config['install_dir'] = "/opt/librenms"; +$config['install_dir'] = "/usr/share/librenms"; ### This should *only* be set if you want to *force* a particular hostname/port ### It will prevent the web interface being usable form any other hostname diff --git a/roles/librenms/templates/vhost.j2 b/roles/librenms/templates/vhost.j2 index 2e23234..af96a46 100644 --- a/roles/librenms/templates/vhost.j2 +++ b/roles/librenms/templates/vhost.j2 @@ -4,7 +4,7 @@ server { server_name {{ librenms_domain }}; - root /opt/librenms/html; + root /usr/share/librenms/html; index index.php;