- 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