Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucasheld/ansible-uptime-kuma
Ansible collection of modules to configure Uptime Kuma
https://github.com/lucasheld/ansible-uptime-kuma
ansible ansible-collection uptime-kuma
Last synced: 3 months ago
JSON representation
Ansible collection of modules to configure Uptime Kuma
- Host: GitHub
- URL: https://github.com/lucasheld/ansible-uptime-kuma
- Owner: lucasheld
- License: gpl-3.0
- Created: 2022-07-02T14:04:57.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-10T20:35:17.000Z (7 months ago)
- Last Synced: 2024-06-17T12:35:28.654Z (5 months ago)
- Topics: ansible, ansible-collection, uptime-kuma
- Language: Python
- Homepage:
- Size: 264 KB
- Stars: 133
- Watchers: 4
- Forks: 18
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - lucasheld/ansible-uptime-kuma - Ansible collection of modules to configure Uptime Kuma (ansible)
README
# ansible-uptime-kuma
This collection contains modules that allow to configure [Uptime Kuma](https://github.com/louislam/uptime-kuma) with Ansible.
Python version 3.7+ and Ansible version 2.9+ are required.
Supported Uptime Kuma versions:
| Uptime Kuma | ansible-uptime-kuma | uptime-kuma-api |
|-----------------|---------------------|-----------------|
| 1.21.3 - 1.23.2 | 1.0.0 - 1.2.0 | 1.0.0+ |
| 1.17.0 - 1.21.2 | 0.1.0 - 0.14.0 | 0.1.0 - 0.13.0 |## Installation
This collection requires the python module [uptime-kuma-api](https://github.com/lucasheld/uptime-kuma-api) to communicate with Uptime Kuma. It can be installed using pip:
```shell
pip install uptime-kuma-api
```Alternately, you can install a specific version (e.g. `0.13.0`):
```shell
pip install uptime-kuma-api==0.13.0
```Then install the ansible collection itself:
```shell
ansible-galaxy collection install lucasheld.uptime_kuma
```Alternately, you can install a specific version (e.g. `0.14.0`):
```shell
ansible-galaxy collection install lucasheld.uptime_kuma:==0.14.0
```## Modules
The following modules are available:
- [api_key](https://github.com/lucasheld/ansible-uptime-kuma/wiki/api_key)
- [api_key_info](https://github.com/lucasheld/ansible-uptime-kuma/wiki/api_key_info)
- [docker_host](https://github.com/lucasheld/ansible-uptime-kuma/wiki/docker_host)
- [docker_host_info](https://github.com/lucasheld/ansible-uptime-kuma/wiki/docker_host_info)
- [game_list_info](https://github.com/lucasheld/ansible-uptime-kuma/wiki/game_list_info)
- [login](https://github.com/lucasheld/ansible-uptime-kuma/wiki/login)
- [maintenance](https://github.com/lucasheld/ansible-uptime-kuma/wiki/maintenance)
- [maintenance_info](https://github.com/lucasheld/ansible-uptime-kuma/wiki/maintenance_info)
- [monitor](https://github.com/lucasheld/ansible-uptime-kuma/wiki/monitor)
- [monitor_info](https://github.com/lucasheld/ansible-uptime-kuma/wiki/monitor_info)
- [monitor_tag](https://github.com/lucasheld/ansible-uptime-kuma/wiki/monitor_tag)
- [notification](https://github.com/lucasheld/ansible-uptime-kuma/wiki/notification)
- [notification_info](https://github.com/lucasheld/ansible-uptime-kuma/wiki/notification_info)
- [proxy](https://github.com/lucasheld/ansible-uptime-kuma/wiki/proxy)
- [proxy_info](https://github.com/lucasheld/ansible-uptime-kuma/wiki/proxy_info)
- [settings](https://github.com/lucasheld/ansible-uptime-kuma/wiki/settings)
- [settings_info](https://github.com/lucasheld/ansible-uptime-kuma/wiki/settings_info)
- [setup](https://github.com/lucasheld/ansible-uptime-kuma/wiki/setup)
- [status_page](https://github.com/lucasheld/ansible-uptime-kuma/wiki/status_page)
- [status_page_info](https://github.com/lucasheld/ansible-uptime-kuma/wiki/status_page_info)
- [tag](https://github.com/lucasheld/ansible-uptime-kuma/wiki/tag)
- [tag_info](https://github.com/lucasheld/ansible-uptime-kuma/wiki/tag_info)## Getting started
Directly after the installation of Uptime Kuma, the initial username and password must be set:
```yaml
- name: Specify the initial username and password
lucasheld.uptime_kuma.setup:
api_url: http://127.0.0.1:3001
api_username: admin
api_password: secret123
```For future requests you can either use these credentials directly or a token that must be generated once.
The token usage is recommended because frequent logins lead to a rate limit. In this example we create a new monitor.Option 1 (not recommended): Create a monitor by using the credentials directly:
```yaml
- name: Login with credentials and create a monitor
lucasheld.uptime_kuma.monitor:
api_url: http://127.0.0.1:3001
api_username: admin
api_password: secret123
name: Google
type: http
url: https://google.com
state: present
```Option 2 (recommended): Generate a token and create a monitor by using this token:
```yaml
- name: Login with credentials once and register the result
lucasheld.uptime_kuma.login:
api_url: http://127.0.0.1:3001
api_username: admin
api_password: secret123
register: result- name: Extract the token from the result and set it as fact
set_fact:
api_token: "{{ result.token }}"- name: Login by token and create a monitor
lucasheld.uptime_kuma.monitor:
api_url: http://127.0.0.1:3001
api_token: "{{ api_token }}"
name: Google
type: http
url: https://google.com
state: present
```