Giter Club home page Giter Club logo

ansible-uptimerobot's Introduction

Ansible uptimerobot module

Add/remove sites to uptimerobot service.

Ansible's official module currently only supports startand pause.

Configuration exemple:

Change your group_vars/all/uptimerobot.yml:

Manage monitors:

uptimerobot_targets:
  - { name: "Google", url: "https://gogole.com", state: "present"}
  - { name: "Slashdot", url: "https://slashdot.org", state: "present"}

Manage Alert contacts:

uptimerobot_alert_entries:
  - { alert_name: "Slack",  alert_type: "11", status: "2", value: "https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXX", state: "present" }

See uptimerobot API documentation for more details

Important: ansible-vault is highly recommended to store your uptimerobot_api_key.

$ ansible-vault encrypt group_vars/all/uptimerobot_api_key.yml

Running

$ ansible-playbook main.yml --vault-pass your_vault_pass_file

TODO

  • Add alert support for monitors
  • Alert management support
  • Public pages support
  • Maintenance windows support
  • Ansible check mode support

ansible-uptimerobot's People

Contributors

felipesantiago avatar masaruhoshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ansible-uptimerobot's Issues

reduce API calls

    if state == 'present':
        if newMonitor() == "ok":
            module.exit_json(changed=True, name=name, url=url, state=state)
        elif newMonitor() == "monitor already exists.":
            module.exit_json(changed=False, msg="monitor %s already exists." % name)
[...]
    elif state == "absent":
        if deleteMonitor() == "ok":
            module.exit_json(changed=True, msg="%s" % getMonitorID(), name=name, url=url, state=state,)
        elif deleteMonitor() == "monitor id not found":

newMonitor(), as deleteMonitor() called the same way, trigger an API call. This may (and should be avoided if possible)

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.