Improve change detection for cluster bootstrap
This commit is contained in:
parent
beac302a53
commit
da0f52dab3
@ -242,6 +242,7 @@
|
|||||||
run_once: true
|
run_once: true
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: bootstrap_result
|
register: bootstrap_result
|
||||||
|
changed_when: bootstrap_result is succeeded
|
||||||
|
|
||||||
- name: Save bootstrap result
|
- name: Save bootstrap result
|
||||||
copy:
|
copy:
|
||||||
@ -273,13 +274,15 @@
|
|||||||
- list
|
- list
|
||||||
environment:
|
environment:
|
||||||
NOMAD_TOKEN: "{{ read_secretid.stdout }}"
|
NOMAD_TOKEN: "{{ read_secretid.stdout }}"
|
||||||
run_once: true
|
|
||||||
register: policies
|
register: policies
|
||||||
|
run_once: true
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Copy policy
|
- name: Copy policy
|
||||||
copy:
|
copy:
|
||||||
src: ../acls/nomad-anon-policy.hcl
|
src: ../acls/nomad-anon-policy.hcl
|
||||||
dest: /tmp/anonymous.policy.hcl
|
dest: /tmp/anonymous.policy.hcl
|
||||||
|
delegate_to: "{{ play_hosts[0] }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
register: anon_policy
|
register: anon_policy
|
||||||
|
|
||||||
@ -299,6 +302,18 @@
|
|||||||
delegate_to: "{{ play_hosts[0] }}"
|
delegate_to: "{{ play_hosts[0] }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
|
|
||||||
|
- name: Read scheduler config
|
||||||
|
command:
|
||||||
|
argv:
|
||||||
|
- nomad
|
||||||
|
- operator
|
||||||
|
- scheduler
|
||||||
|
- get-config
|
||||||
|
- -json
|
||||||
|
run_once: true
|
||||||
|
register: scheduler_config
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Enable service scheduler preemption
|
- name: Enable service scheduler preemption
|
||||||
command:
|
command:
|
||||||
argv:
|
argv:
|
||||||
@ -306,12 +321,24 @@
|
|||||||
- operator
|
- operator
|
||||||
- scheduler
|
- scheduler
|
||||||
- set-config
|
- set-config
|
||||||
- -preempt-system-scheduler=true
|
|
||||||
- -preempt-service-scheduler=true
|
- -preempt-service-scheduler=true
|
||||||
environment:
|
environment:
|
||||||
NOMAD_TOKEN: "{{ read_secretid.stdout }}"
|
NOMAD_TOKEN: "{{ read_secretid.stdout }}"
|
||||||
delegate_to: "{{ play_hosts[0] }}"
|
|
||||||
run_once: true
|
run_once: true
|
||||||
|
when: (scheduler_config.stdout | from_json)["SchedulerConfig"]["PreemptionConfig"]["ServiceSchedulerEnabled"] is false
|
||||||
|
|
||||||
|
- name: Enable system scheduler preemption
|
||||||
|
command:
|
||||||
|
argv:
|
||||||
|
- nomad
|
||||||
|
- operator
|
||||||
|
- scheduler
|
||||||
|
- set-config
|
||||||
|
- -preempt-system-scheduler=true
|
||||||
|
environment:
|
||||||
|
NOMAD_TOKEN: "{{ read_secretid.stdout }}"
|
||||||
|
run_once: true
|
||||||
|
when: (scheduler_config.stdout | from_json)["SchedulerConfig"]["PreemptionConfig"]["SystemSchedulerEnabled"] is false
|
||||||
|
|
||||||
# - name: Set up Nomad backend and roles in Vault
|
# - name: Set up Nomad backend and roles in Vault
|
||||||
# community.general.terraform:
|
# community.general.terraform:
|
||||||
|
Loading…
Reference in New Issue
Block a user