Add heartbeat

This commit is contained in:
Lino Silva
2024-11-15 15:04:54 +00:00
parent 53489b5764
commit 5d8e0effe1
14 changed files with 446 additions and 255 deletions
@@ -0,0 +1,38 @@
- name: Ensure the {{ uptime_kuma_user }} user exists
ansible.builtin.user:
name: "{{ uptime_kuma_user }}"
home: "{{ uptime_kuma_home }}"
shell: /usr/sbin/nologin
system: true
state: present
- name: Configure repo and node
shell: |
git config --global --add safe.directory {{ uptime_kuma_installation_directory }}
- name: Clone the uptime-kuma repo
ansible.builtin.git:
repo: https://github.com/louislam/uptime-kuma.git
dest: "{{ uptime_kuma_installation_directory }}"
version: "{{ uptime_kuma_version }}"
register: uptime_git
notify: set directory permissions
- name: Configure repo and node
shell: |
cd {{ uptime_kuma_installation_directory }}
npm run setup
- name: Copy the template file for the uptime-kuma service
ansible.builtin.template:
src: templates/uptime-kuma.service.j2
dest: /etc/systemd/system/uptime-kuma.service
mode: u=rw,g=r,o=r
notify:
- daemon reload
- restart uptime-kuma
- name: Ensure the service is enabled
ansible.builtin.service:
name: uptime-kuma.service
enabled: true