Skip to content

Commit

Permalink
Add a config check before restarting mimir (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
GVengelen authored May 21, 2024
2 parents afba489 + 17955b7 commit 7df5771
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions roles/mimir/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@
group: "mimir"
mode: "0755"

- name: Template Mimir config - /etc/mimir/config.yml
ansible.builtin.template:
src: "config.yml.j2"
dest: "/etc/mimir/config.yml"
owner: "mimir"
group: "mimir"
mode: "0644"
notify:
- Restart mimir

- name: Ensure that Mimir rule path exists
ansible.builtin.file:
path: "{{ mimir_ruler_alert_path }}"
Expand All @@ -88,12 +78,27 @@
- mimir_ruler_alert_path is defined
- mimir_ruler is defined

- name: Template Mimir config - /etc/mimir/config.yml
ansible.builtin.template:
src: "config.yml.j2"
dest: "/etc/mimir/config.yml"
owner: "mimir"
group: "mimir"
mode: "0644"
validate: "mimir -modules --config.file=%s"
notify:
- Restart mimir

- name: Ensure restart has completed
ansible.builtin.meta: flush_handlers

- name: Ensure that Mimir is started
ansible.builtin.systemd:
name: mimir.service
state: started
enabled: true


- name: Verify that Mimir URL is responding
ansible.builtin.uri:
url: "http://127.0.0.1:{{ mimir_http_listen_port }}/ready"
Expand Down

0 comments on commit 7df5771

Please sign in to comment.