library/roles/piwik/tasks/main.yml: The archive cron job is installed conditionally.

infrastructure-services/roles/analytics: Run the log import job as piwik user.
This commit is contained in:
Andrea Dell'Amico 2016-05-31 17:21:47 +02:00
parent a21d62af25
commit ae7ec8a9b7
2 changed files with 3 additions and 0 deletions

View File

@ -2,6 +2,8 @@
piwik_repo_key: 'https://debian.piwik.org/repository.gpg'
piwik_repo: 'deb https://debian.piwik.org/ piwik main'
piwik_install_archive_cron: True
piwik_under_nginx: True
piwik_under_phpfpm: True
piwik_user: piwik

View File

@ -20,6 +20,7 @@
- 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
when: piwik_install_archive_cron
tags: [ 'piwik', 'analytics' ]
- name: Create a directory for the fcgi cache