uptime-kuma/ansible
Muhammed Hussein karimi 10220ec5bc
always recreate uptime kuma containers
this will fix the problem when you change nginx configuration and containers are not reloaded
2022-01-15 01:08:50 +03:30
..
roles always recreate uptime kuma containers 2022-01-15 01:08:50 +03:30
.gitignore better ssl handling 2021-10-22 21:08:19 +03:30
ansible-requirements.yml installing docker python library 2021-10-22 21:30:56 +03:30
playbook.yml fix: nginx role should run before uptime-kuma role 2021-12-14 20:17:40 +03:30
README.md some minor features and fixes for ansible role 2021-12-14 01:14:44 +03:30

Ansible Playbook to install uptime kuma using docker

This playbook comes with three roles

  1. docker (to install docker)
  2. nginx (to install nginx using docker with ssl)
  3. uptime kuma (to install uptime kuma using docker)

To see more info see docker-compose, tasks and config files I will try to make this readme better

To run it

  1. install ansible see here
  2. run ansible-galaxy install -r ansible-requirements.yml to get requirements
  3. prepare inventory hosts
  4. put your certificates in files section in nginx role with this structure below:
ansible -> roles -> nginx -> files -> ssl -> <uptime kuma domain>.fullchain.pem
ansible -> roles -> nginx -> files -> ssl -> <uptime kuma domain>.privkey.pem
  1. to run playbook
ansible-playbook ./playbook.yml -i <your inventory path> -e "kuma_domain=<uptime kuma domain>" -e "kuma_image_os=<alpine or debian>" -e "kuma_image_version=<version>"

you can use other ansible playbook options too

Note: Replace <uptime kuma domain> with your desired domain for uptime kuma

replace <version> with a version from https://github.com/louislam/uptime-kuma/releases replace <alpine or debian> with one of options

-e "kuma_image_os=<alpine or debian>" -e "kuma_image_version=<version>" is not required and you can remove this part or change only one of them (kuma_image_os is debian & kuma_image_version is 1 by default)

If you are not using root user as your ansible_user use -bK option to become root

instead of -e "kuma_image_os=<alpine or debian>" -e "kuma_image_version=<version>" You can use -e kuma_tag=<uptime kuma full tag> and replace <uptime kuma full tag> with your desired tag (e.g. latest)

you can also create a yaml file with variables that you want to set & use it (also: ansible-vars)