mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-27 08:15:54 +02:00
Update to 2022-08-09 13:00
This commit is contained in:
BIN
roles/nomad/tasks/.conf.yml.swp
Normal file
BIN
roles/nomad/tasks/.conf.yml.swp
Normal file
Binary file not shown.
@@ -1,12 +1,62 @@
|
||||
---
|
||||
|
||||
- name: Deploy nomad configuration
|
||||
template:
|
||||
src: nomad.hcl.j2
|
||||
dest: "{{ nomad_root_dir }}/etc/nomad.hcl"
|
||||
owner: root
|
||||
group: "{{ nomad_user }}"
|
||||
mode: 0640
|
||||
validate: nomad config validate %s
|
||||
notify: restart nomad
|
||||
block:
|
||||
- name: Deploy nomad configuration
|
||||
template:
|
||||
src: nomad.hcl.j2
|
||||
dest: "{{ nomad_root_dir }}/etc/nomad.hcl"
|
||||
owner: root
|
||||
group: "{{ nomad_user }}"
|
||||
mode: 0640
|
||||
backup: True
|
||||
register: nomad_main_conf
|
||||
notify: restart nomad
|
||||
|
||||
- name: Deploy nomad reloadable configuration
|
||||
template:
|
||||
src: reload.hcl.j2
|
||||
dest: "{{ nomad_root_dir }}/etc/reload.hcl"
|
||||
owner: root
|
||||
group: "{{ nomad_user }}"
|
||||
mode: 0640
|
||||
backup: True
|
||||
register: nomad_reload_conf
|
||||
notify: reload nomad
|
||||
|
||||
- name: Validate configuration
|
||||
command: nomad config validate {{ nomad_root_dir }}/etc/nomad.hcl {{ nomad_root_dir }}/etc/reload.hcl
|
||||
changed_when: False
|
||||
become_user: "{{ nomad_user }}"
|
||||
register: nomad_conf_validation
|
||||
|
||||
rescue:
|
||||
- block:
|
||||
- name: Restore main configuration
|
||||
copy:
|
||||
src: "{{ nomad_main_conf.backup_file }}"
|
||||
dest: "{{ nomad_root_dir }}/etc/nomad.hcl"
|
||||
remote_src: True
|
||||
owner: root
|
||||
group: "{{ nomad_user }}"
|
||||
mode: 0640
|
||||
when: nomad_main_conf.backup_file is defined
|
||||
|
||||
- name: Restore reloadable configuration
|
||||
copy:
|
||||
src: "{{ nomad_reload_conf.backup_file }}"
|
||||
dest: "{{ nomad_root_dir }}/etc/reload.hcl"
|
||||
remote_src: True
|
||||
owner: root
|
||||
group: "{{ nomad_user }}"
|
||||
mode: 0640
|
||||
when: nomad_reload_conf.backup_file is defined
|
||||
|
||||
tags: nomad
|
||||
|
||||
- name: Fail if configuration validation failed
|
||||
fail:
|
||||
msg: "Failed to validate configuration: {{ nomad_conf_validation.stdout }}"
|
||||
when: nomad_conf_validation.rc != 0
|
||||
tags: nomad
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
data_dir = "{{ nomad_root_dir }}/data"
|
||||
plugin_dir = "{{ nomad_root_dir }}/plugins"
|
||||
log_level = "{{ nomad_conf.log_level }}"
|
||||
bind_addr = "0.0.0.0"
|
||||
|
||||
{% if nomad_conf.datacenter is defined %}
|
||||
|
@@ -9,7 +9,7 @@ ConditionFileNotEmpty={{ nomad_root_dir }}/etc/nomad.hcl
|
||||
EnvironmentFile=-{{ nomad_root_dir }}/etc/nomad.env
|
||||
User={{ nomad_user }}
|
||||
Group={{ nomad_user }}
|
||||
ExecStart={{ nomad_root_dir }}/bin/nomad agent -config={{ nomad_root_dir }}/etc/nomad.hcl
|
||||
ExecStart={{ nomad_root_dir }}/bin/nomad agent -config={{ nomad_root_dir }}/etc/
|
||||
ExecReload=/bin/kill --signal HUP $MAINPID
|
||||
SuccessExitStatus=1
|
||||
Restart=on-failure
|
||||
|
1
roles/nomad/templates/reload.hcl.j2
Normal file
1
roles/nomad/templates/reload.hcl.j2
Normal file
@@ -0,0 +1 @@
|
||||
log_level = "{{ nomad_conf.log_level }}"
|
Reference in New Issue
Block a user