-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add hermes update config playbook (#19)
- Loading branch information
1 parent
3c785d8
commit 96a2d8c
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
- name: Update Hermes config | ||
hosts: "{{ hosts | default('monitoring') }}" | ||
|
||
tasks: | ||
- name: Copy Hermes config | ||
ansible.builtin.copy: | ||
src: "../../configs/hermes/{{ inventory_hostname }}.toml" | ||
dest: "{{ ansible_user_dir }}/.hermes/config.toml" | ||
mode: "0755" | ||
|
||
- name: Verify Hermes config | ||
ansible.builtin.command: hermes config validate | ||
changed_when: false | ||
register: hermes_config | ||
|
||
- name: Print Hermes config validation result | ||
ansible.builtin.debug: | ||
msg: | ||
- "Stdout:" | ||
- "{{ (hermes_config.stdout).split('\n') }}" | ||
- "Stderr:" | ||
- "{{ (hermes_config.stderr).split('\n') }}" | ||
|
||
- name: Restart Hermes | ||
become: true | ||
ansible.builtin.systemd: | ||
state: restarted | ||
name: hermes | ||
enabled: true | ||
daemon_reload: true |