2016-03-17 21:35:04 +01:00
|
|
|
---
|
|
|
|
- name: Install the piwik repo key
|
|
|
|
apt_key: url={{ piwik_repo_key }} state=present
|
|
|
|
tags: [ 'piwik', 'analytics' ]
|
|
|
|
|
|
|
|
- name: Install the piwik debian repo
|
2017-04-18 11:19:32 +02:00
|
|
|
apt_repository: repo='{{ piwik_repo }}' state=present update_cache=yes
|
2016-03-17 21:35:04 +01:00
|
|
|
tags: [ 'piwik', 'analytics' ]
|
|
|
|
|
|
|
|
- name: Install piwik and some dependencies
|
2017-04-18 11:19:32 +02:00
|
|
|
apt: name={{ item }} state={{ piwik_pkg_state }} update_cache=yes cache_valid_time=3600
|
2016-03-17 21:35:04 +01:00
|
|
|
with_items: '{{ piwik_pkgs }}'
|
|
|
|
tags: [ 'piwik', 'analytics' ]
|
|
|
|
|
|
|
|
- name: Restore the piwik permissions so that they match the fpm config
|
|
|
|
shell: find {{ item }} -user www-data -exec chown {{ piwik_user }} {} \; ; find {{ item }} -group www-data -exec chgrp {{ piwik_user }} {} \;
|
|
|
|
with_items: '{{ piwik_owned_data }}'
|
|
|
|
when: piwik_under_phpfpm
|
|
|
|
tags: [ 'piwik', 'analytics' ]
|
|
|
|
|
|
|
|
- name: Install a cron job to archive the old logs data
|
|
|
|
cron: minute="5" user={{ piwik_user }} name="Archive Piwik Log Data" job='[ -e /usr/share/piwik/console ] && [ -x /usr/bin/php ] && nice /usr/bin/php /usr/share/piwik/console core:archive --url="{{ piwik_url }}" >> /var/log/piwik/piwik-archive.log 2>&1' cron_file=piwik-archive
|
2016-05-31 17:21:47 +02:00
|
|
|
when: piwik_install_archive_cron
|
2016-03-17 21:35:04 +01:00
|
|
|
tags: [ 'piwik', 'analytics' ]
|
|
|
|
|
|
|
|
- name: Create a directory for the fcgi cache
|
2017-04-18 11:19:32 +02:00
|
|
|
file: dest=/var/cache/nginx/fcgicache state=directory owner=piwik
|
2016-03-17 21:35:04 +01:00
|
|
|
when: piwik_under_nginx
|
|
|
|
tags: [ 'piwik', 'analytics' ]
|