GithubHelp home page GithubHelp logo

afrimberger / ansible-uptime-kuma Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lucasheld/ansible-uptime-kuma

0.0 0.0 0.0 392 KB

Ansible collection of modules to configure Uptime Kuma

License: GNU General Public License v3.0

Shell 0.87% Python 99.13%

ansible-uptime-kuma's Introduction

ansible-uptime-kuma

This collection contains modules that allow to configure Uptime Kuma with Ansible.

Python version 3.7+ and Ansible version 2.10+ are required.

Supported Uptime Kuma versions:

Uptime Kuma ansible-uptime-kuma uptime-kuma-api
1.21.3 1.0.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 to communicate with Uptime Kuma. It can be installed using pip:

pip install uptime-kuma-api

Alternately, you can install a specific version (e.g. 0.13.0):

pip install uptime-kuma-api==0.13.0

Then install the ansible collection itself:

ansible-galaxy collection install lucasheld.uptime_kuma

Alternately, you can install a specific version (e.g. 0.14.0):

ansible-galaxy collection install lucasheld.uptime_kuma:==0.14.0

Modules

The following modules are available:

Getting started

Directly after the installation of Uptime Kuma, the initial username and password must be set:

- 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:

- 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:

- 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

ansible-uptime-kuma's People

Contributors

beechesii avatar larsl-net avatar lucasheld avatar spkenney avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.