From 98239899db4b0b16a4e56ac6ed788cca6636707a Mon Sep 17 00:00:00 2001 From: Mattia Verga Date: Sun, 22 Mar 2020 10:08:30 +0100 Subject: [PATCH] review-stats: sync files with correct permission on staging Signed-off-by: Mattia Verga --- .../proxy/files/sync-review-stats-new.cron | 1 + roles/review-stats/proxy/tasks/main.yml | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 roles/review-stats/proxy/files/sync-review-stats-new.cron diff --git a/roles/review-stats/proxy/files/sync-review-stats-new.cron b/roles/review-stats/proxy/files/sync-review-stats-new.cron new file mode 100644 index 000000000..aa1e5e679 --- /dev/null +++ b/roles/review-stats/proxy/files/sync-review-stats-new.cron @@ -0,0 +1 @@ +3 * * * * root /usr/bin/rsync -a --delete --chown=apache:apache sundries01::review-stats/* /srv/web/review-stats/ >& /dev/null diff --git a/roles/review-stats/proxy/tasks/main.yml b/roles/review-stats/proxy/tasks/main.yml index e95fe4884..a674c44ba 100644 --- a/roles/review-stats/proxy/tasks/main.yml +++ b/roles/review-stats/proxy/tasks/main.yml @@ -3,6 +3,14 @@ tags: - review-stats - review-stats/proxy + when: env != "staging" + +- name: Ensure dir for content exists + file: dest=/srv/web/review-stats owner=apache group=apache mode=0755 state=directory + tags: + - review-stats + - review-stats/proxy + when: env == "staging" - name: Put the proxy config in place template: > @@ -23,3 +31,15 @@ - cron - review-stats - review-stats/proxy + when: env != "staging" + + +- name: Install the sync-review-stats cronjob to pull content from builder + copy: > + src=sync-review-stats-new.cron dest=/etc/cron.d/sync-review-stats.cron + owner=root group=root mode=0644 + tags: + - cron + - review-stats + - review-stats/proxy + when: env == "staging" -- 2.25.1