--- - name: Set up Uptime Kuma on all servers hosts: hosts remote_user: root tasks: - name: Install Needed Packages ansible.builtin.apt: pkg: - nginx - curl - git update_cache: yes - name: Install NodeJS Source ansible.builtin.shell: 'curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt' - name: Install NodeJS ansible.builtin.apt: update_cache: yes name: nodejs - name: Clone Uptime Kuma ansible.builtin.shell: 'cd /root/ && git clone https://github.com/louislam/uptime-kuma.git' - name: Run NPM Commands ansible.builtin.shell: 'cd /root/uptime-kuma/ && npm run setup && npm install pm2 -g' - name: Install logrotate ansible.builtin.shell: 'cd /root/uptime-kuma/ && pm2 install pm2-logrotate' - name: Start Kuma Server ansible.builtin.shell: 'cd /root/uptime-kuma/ && pm2 start server/server.js --name uptime-kuma && pm2 startup' - name: NGINX Config become: true ansible.builtin.copy: src: 'files/uptime-kuma.conf' dest: /etc/nginx/conf.d/uptime-kuma.conf owner: root group: root mode: '0644' - name: Restart NGINX ansible.builtin.systemd_service: name: nginx state: restarted enabled: true