From 5acf91a3f62e5c23e1510047dea41c9788e6acfc Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 28 Apr 2020 11:14:18 -0700 Subject: [PATCH] Don't restart the zuul scheduler in prod We use the zuul_scheduler_start flag to determine if we want to start the zuul-scheduler when new containers show up. Unfortunately we weren't setting zuul_scheduler_start in prod so we failed with this error: error while evaluating conditional (zuul_scheduler_start | bool): 'zuul_scheduler_start' is undefined Fix this by treating an unset var as equivalent to a set truthy var value. We do this instead of always setting the var to false in prod as it simplifies testing. Change-Id: I1f1a86e80199601646c7f2dec2a91c5d65d77231 --- playbooks/roles/zuul-scheduler/handlers/main.yaml | 4 ++-- playbooks/roles/zuul-scheduler/tasks/main.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/zuul-scheduler/handlers/main.yaml b/playbooks/roles/zuul-scheduler/handlers/main.yaml index 5a70b4c1ee..185979bf89 100644 --- a/playbooks/roles/zuul-scheduler/handlers/main.yaml +++ b/playbooks/roles/zuul-scheduler/handlers/main.yaml @@ -2,5 +2,5 @@ shell: cmd: docker-compose exec -T scheduler zuul-scheduler smart-reconfigure chdir: /etc/zuul-scheduler - # Don't run a restart if we're starting zuul with the playbook - when: not zuul_scheduler_start|bool + # Don't run a reconfigure if we're starting zuul with the playbook + when: zuul_scheduler_start is not defined or not zuul_scheduler_start|bool diff --git a/playbooks/roles/zuul-scheduler/tasks/main.yaml b/playbooks/roles/zuul-scheduler/tasks/main.yaml index 592f314044..86254bc82b 100644 --- a/playbooks/roles/zuul-scheduler/tasks/main.yaml +++ b/playbooks/roles/zuul-scheduler/tasks/main.yaml @@ -70,4 +70,4 @@ - name: Start containers include_tasks: start.yaml - when: zuul_scheduler_start | bool + when: zuul_scheduler_start is defined and zuul_scheduler_start | bool