From a80927e5b045a8af98d348ba78c14a7d90fa8349 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Fri, 16 Sep 2022 16:45:26 -0700 Subject: [PATCH] Enable preemption on nomad scheduler --- setup-cluster.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/setup-cluster.yml b/setup-cluster.yml index 0df9359..309f159 100644 --- a/setup-cluster.yml +++ b/setup-cluster.yml @@ -360,10 +360,6 @@ state: started name: nomad -- name: Bootstrap Nomad ACLs - hosts: nomad_instances - - tasks: - name: Nomad API reachable? uri: url: "http://127.0.0.1:4646/v1/status/leader" @@ -376,6 +372,11 @@ changed_when: false run_once: true + +- name: Bootstrap Nomad ACLs and scheduler + hosts: nomad_instances + + tasks: - name: Bootstrap ACLs command: argv: @@ -408,6 +409,20 @@ changed_when: false register: read_secretid + - name: Enable service scheduler preemption + command: + argv: + - nomad + - operator + - scheduler + - set-config + - -preempt-system-scheduler=true + - -preempt-service-scheduler=true + environment: + NOMAD_TOKEN: "{{ read_secretid.stdout }}" + delegate_to: "{{ play_hosts[0] }}" + run_once: true + - name: Look for policy command: argv: