mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
run command to get redis log path in cronjob for redis bgsave. This way if the container id changes for any reason, the change will be picked up when the cronjob starts instead of being evaluated only when the cronjob is deployed with ansible
This commit is contained in:
parent
dfe72b3e04
commit
5cbe285888
1 changed files with 3 additions and 15 deletions
|
@ -46,19 +46,6 @@
|
|||
name: newsblurnet
|
||||
notify: restart docker
|
||||
|
||||
- name: Get log file location for redis
|
||||
become: yes
|
||||
shell: docker inspect --format="{{ '{{' }}.LogPath {{ '}}' }}" redis
|
||||
register: redis_log_path
|
||||
tags:
|
||||
- sanity-checker
|
||||
|
||||
- name: show redis_log_path
|
||||
debug:
|
||||
msg: "{{ redis_log_path.stdout }}"
|
||||
tags:
|
||||
- sanity-checker
|
||||
|
||||
- name: Add sanity checkers cronjob for redis bg_save
|
||||
become: yes
|
||||
cron:
|
||||
|
@ -67,12 +54,13 @@
|
|||
cron_file: /etc/cron.hourly/redis_bg_save_sanity_checker
|
||||
job: >-
|
||||
docker pull newsblur/newsblur_python3:latest;
|
||||
REDIS_LOG_PATH=$(eval docker inspect --format="{{ '{{' }}.LogPath {{ '}}' }}" redis)
|
||||
docker run --rm -it
|
||||
-v {{redis_log_path.stdout}}:{{redis_log_path.stdout}}
|
||||
-v ${REDIS_LOG_PATH}:${REDIS_LOG_PATH}
|
||||
-v /srv/newsblur:/srv/newsblur
|
||||
-h `cat /etc/hostname`
|
||||
--network=newsblurnet
|
||||
newsblur/newsblur_python3 /srv/newsblur/utils/monitor_redis_bgsave.py {{redis_log_path.stdout}}
|
||||
newsblur/newsblur_python3 /srv/newsblur/utils/monitor_redis_bgsave.py $REDIS_LOG_PATH
|
||||
when: "'redis' in inventory_hostname"
|
||||
tags:
|
||||
- sanity-checker
|
||||
|
|
Loading…
Add table
Reference in a new issue