From a5b6789ee8e6899304c36751aa53e76ad4d7915b Mon Sep 17 00:00:00 2001 From: Benjamin Sanders Date: Sun, 6 Sep 2026 15:48:35 -0400 Subject: added install uptime playbooks --- install-uptime-kuma-playbook.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 install-uptime-kuma-playbook.yml (limited to 'install-uptime-kuma-playbook.yml') diff --git a/install-uptime-kuma-playbook.yml b/install-uptime-kuma-playbook.yml new file mode 100644 index 0000000..76c6e1b --- /dev/null +++ b/install-uptime-kuma-playbook.yml @@ -0,0 +1,39 @@ +--- +- name: Set up Uptime Kuma on all servers + hosts: hosts + remote_user: root + tasks: + - name: Install Needed Packages + ansible.builtin.apt: + update_cache: yes + pkg: + - nginx + - curl + - git + - 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 -- cgit v1.2.3