From a0d7feb5c14e85bfacc45a07757acc13d3a55523 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 14 Jul 2015 03:01:30 +0200 Subject: [PATCH] library/roles/revive-adserver: some fixes --- revive-adserver/defaults/main.yml | 3 +++ revive-adserver/tasks/main.yml | 9 +++++++++ revive-adserver/templates/revive_maintenance_cron.j2 | 5 +++++ 3 files changed, 17 insertions(+) create mode 100644 revive-adserver/templates/revive_maintenance_cron.j2 diff --git a/revive-adserver/defaults/main.yml b/revive-adserver/defaults/main.yml index 560a499..b3b71ef 100644 --- a/revive-adserver/defaults/main.yml +++ b/revive-adserver/defaults/main.yml @@ -9,6 +9,9 @@ revive_ad_dir: '{{ revive_ad_install_dir }}/revive-adserver/' revive_ad_dest_dir: '{{ revive_ad_dir }}/ad' revive_ad_images_dest_dir: '{{ revive_ad_dir }}/images' revive_ad_user: revive +revive_maintenance_path: '{{ revive_ad_dest_dir }}/scripts/maintenance/maintenance.php' +revive_automatic_maintenance: True +revive_domain: example.com revive_ad_php_modules: - php-xml-parser diff --git a/revive-adserver/tasks/main.yml b/revive-adserver/tasks/main.yml index b15d0a5..5ee4b13 100644 --- a/revive-adserver/tasks/main.yml +++ b/revive-adserver/tasks/main.yml @@ -77,3 +77,12 @@ - php - revive - revive_adserver + +- name: Install the cron job needed for the automatic maintenance + template: src=revive_maintenance_cron.j2 dest=/etc/cron.hourly/revive_adserver_maintenance owner=root group=root mode=0555 + when: revive_automatic_maintenance + tags: + - php + - revive + - revive_adserver + - revive_cron diff --git a/revive-adserver/templates/revive_maintenance_cron.j2 b/revive-adserver/templates/revive_maintenance_cron.j2 new file mode 100644 index 0000000..ddbdc38 --- /dev/null +++ b/revive-adserver/templates/revive_maintenance_cron.j2 @@ -0,0 +1,5 @@ +#!/bin/bash + +exec /usr/bin/php {{ revive_maintenance_path }} {{ revive_domain }} > /var/log/revive_adserver_maintenance.log 2>&1 + +exit 0