2021-10-11 20:18:01 +00:00
# Ansible Playbook to install uptime kuma using docker
This playbook comes with three roles
2021-10-23 19:34:47 +00:00
1. docker (to install docker)
2. nginx (to install nginx using docker with ssl)
3. uptime kuma (to install uptime kuma using docker)
2021-10-11 20:18:01 +00:00
To see more info see docker-compose, tasks and config files
2021-10-11 20:21:17 +00:00
I will try to make this readme better
2021-10-22 17:22:13 +00:00
## To run it
2021-10-23 19:34:47 +00:00
1. install ansible see [here ](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html )
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:
2021-10-22 17:38:19 +00:00
```
2021-12-13 21:44:44 +00:00
ansible -> roles -> nginx -> files -> ssl -> < uptime kuma domain > .fullchain.pem
ansible -> roles -> nginx -> files -> ssl -> < uptime kuma domain > .privkey.pem
2021-10-22 17:38:19 +00:00
```
2021-10-23 19:34:47 +00:00
5. to run playbook
2021-10-22 17:22:13 +00:00
```bash
2021-11-08 17:31:52 +00:00
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 > "
2021-10-22 17:22:13 +00:00
```
you can use other ansible playbook options too
2021-10-22 17:38:19 +00:00
> Note: Replace `<uptime kuma domain>` with your desired domain for uptime kuma
2021-12-13 21:44:44 +00:00
2021-11-08 17:31:52 +00:00
> replace `<version>` with a version from https://github.com/louislam/uptime-kuma/releases
> replace `<alpine or debian>` with one of options
2021-12-13 21:44:44 +00:00
2021-11-08 17:31:52 +00:00
> `-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)
2021-12-13 21:44:44 +00:00
2021-10-24 08:12:09 +00:00
> If you are not using root user as your ansible_user use -bK option to become root
2021-12-13 21:44:44 +00:00
> 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)