From 96a2d8c0d3e6d09d527cac6f03f4a0ddd3ff3ddf Mon Sep 17 00:00:00 2001 From: Sergey <83376337+freak12techno@users.noreply.github.com> Date: Sat, 29 Jun 2024 03:27:36 +0300 Subject: [PATCH] feat: add hermes update config playbook (#19) --- playbooks/hermes/01-update-config.yml | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 playbooks/hermes/01-update-config.yml diff --git a/playbooks/hermes/01-update-config.yml b/playbooks/hermes/01-update-config.yml new file mode 100644 index 0000000..ac86d7c --- /dev/null +++ b/playbooks/hermes/01-update-config.yml @@ -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