diff options
| author | Benjamin Sanders <hello@bensanders.net> | 2026-09-06 15:48:35 -0400 |
|---|---|---|
| committer | Benjamin Sanders <hello@bensanders.net> | 2026-09-06 15:48:35 -0400 |
| commit | a5b6789ee8e6899304c36751aa53e76ad4d7915b (patch) | |
| tree | b57fbd785dbca6e7eedc3e578a644c8fe5f1b953 /install-uptime-kuma-playbook.yml | |
| parent | 594ea62e92845f1a3a0a8c7c065ca0e1bbafa2ae (diff) | |
added install uptime playbooks
Diffstat (limited to 'install-uptime-kuma-playbook.yml')
| -rw-r--r-- | install-uptime-kuma-playbook.yml | 39 |
1 files changed, 39 insertions, 0 deletions
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 |
