From 073e8db02f46ae389bdbd2e25cc88efb66cbfa96 Mon Sep 17 00:00:00 2001 From: Jimmy McCrory Date: Sat, 20 Oct 2018 13:52:37 -0700 Subject: [PATCH] Make horizon DB management cron task idempotent Use a seed in the glance cache management cron task's random filter so that each host's results are idempotent when re-running. This prevents the constant changing of the crontab whenever the playbook is run. Change-Id: I441d5d30e06f24a1149926f9068e7e4838b3a723 --- tasks/horizon_db_setup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/horizon_db_setup.yml b/tasks/horizon_db_setup.yml index 2a6a61ab..a82ed602 100644 --- a/tasks/horizon_db_setup.yml +++ b/tasks/horizon_db_setup.yml @@ -48,7 +48,7 @@ - name: Register DB session cleanup cron cron: name: "Clear out expired sessions" - minute: "{{ 58 | random(start=2) }}" + minute: "{{ 58 | random(seed=inventory_hostname, start=2) }}" hour: 21 job: "{{ horizon_manage }} clearsessions" user: "{{ horizon_system_user_name }}"