Skip to content

Commit

Permalink
Merge pull request #30 from remerge/CORE-363-support-configuration-of…
Browse files Browse the repository at this point in the history
…-default-scheduler-config-for-server-roles-in-ansible-nomad-role

CORE-363 Support specification  of default_scheduler_config
  • Loading branch information
tundeaoni committed Feb 29, 2024
2 parents 6bfea48 + 15b8fcf commit 11cb73a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ nomad_client_host_networks: []
nomad_client_max_kill_timeout: 5m
nomad_docker_auth_enabled: false
nomad_docker_auth_file: /root/.docker/config.json

nomad_batch_scheduler_enabled: true
nomad_scheduler_enabled: true
nomad_service_scheduler_enabled: true
nomad_sysbatch_scheduler_enabled: true
28 changes: 28 additions & 0 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,34 @@
- nomad_client is boolean
quiet: true

- name: assert | Test if nomad_sysbatch_scheduler_enabled is set correctly
ansible.builtin.assert:
that:
- nomad_sysbatch_scheduler_enabled is defined
- nomad_sysbatch_scheduler_enabled is boolean
quiet: true

- name: assert | Test if nomad_service_scheduler_enabled is set correctly
ansible.builtin.assert:
that:
- nomad_service_scheduler_enabled is defined
- nomad_service_scheduler_enabled is boolean
quiet: true

- name: assert | Test if nomad_scheduler_enabled is set correctly
ansible.builtin.assert:
that:
- nomad_scheduler_enabled is defined
- nomad_scheduler_enabled is boolean
quiet: true

- name: assert | Test if nomad_batch_scheduler_enabled is set correctly
ansible.builtin.assert:
that:
- nomad_batch_scheduler_enabled is defined
- nomad_batch_scheduler_enabled is boolean
quiet: true

- name: assert | Test if nomad_client_node_class is set correctly
ansible.builtin.assert:
that:
Expand Down
9 changes: 9 additions & 0 deletions templates/server.hcl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@
server {
enabled = true
bootstrap_expect = {{ nomad_server_bootstrap_expect }}

default_scheduler_config {
preemption_config {
batch_scheduler_enabled = {{ nomad_batch_scheduler_enabled }}
system_scheduler_enabled = {{ nomad_scheduler_enabled }}
service_scheduler_enabled = {{ nomad_service_scheduler_enabled }}
sysbatch_scheduler_enabled = {{ nomad_sysbatch_scheduler_enabled }}
}
}
}

0 comments on commit 11cb73a

Please sign in to comment.