Skip to content

Commit cc241e9

Browse files
committed
Fix judgehost playbook if service has not been deployed yet
1 parent c1f9db1 commit cc241e9

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

provision-contest/ansible/judgehost.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,20 @@
4242
tags: prometheus_target_all
4343
when: GRAFANA_MONITORING
4444
pre_tasks:
45-
- name: Get current services
46-
service_facts:
45+
- name: Check if the service is already available
46+
stat:
47+
path: /etc/systemd/system/[email protected]
48+
get_attributes: false
49+
get_checksum: false
50+
get_mime: false
51+
register: service_file
52+
4753
- name: Disable all cores
4854
service:
49-
name="domjudge-judgedaemon@{{ item }}"
50-
state=stopped
55+
name: "domjudge-judgedaemon@{{ item }}"
56+
state: stopped
5157
with_sequence: start=0 end={{ ansible_processor_vcpus }} format=domjudge-judgedaemon@%1x
52-
when: '"[email protected]" in services'
58+
when: service_file.stat.exists
5359
tasks:
5460
- name: add autostart shortcuts
5561
template:

0 commit comments

Comments
 (0)