Giter VIP home page Giter VIP logo

eda_collection's Introduction

Event Driven Automation Collection - wwt.eda

The goal of this collection is to provide a variety of event-source plugins and filters for Event-Driven Ansible.

Plugins

The following plugins are included in the collection

Name Description
wwt.eda.mqtt MQTT Event Source Plugin
wwt.eda.bigpanda Big Panda Event Source Plugin

wwt.eda.mqtt plugin

This plugin was originally based off of the work done by Alessandro Rossi (https://github.com/kubealex) and his MQTT event-source plugin.

wwt.eda.bigpanda

This is a new plugin to integrate with Big Panda and collect incidents as a source for event-driven ansible.

Python Dependencies

See requirements.txt for python dependencies.

Usage

wwt.eda.mqtt Usage

A sample rulebook using wwt.eda.mqtt plugin is shown below:

---
- name: Meraki MT30 Sensor Button Presses
  hosts: all
  sources:
    - wwt.eda.mqtt:
        host: <host>
        port: 8883
        username: <username>
        password: <password>
        ca_certs: |-
          -----BEGIN CERTIFICATE-----
          <cert contents>
          -----END CERTIFICATE-----
        validate_certs: false
        topic: meraki/v1/mt/#
      filters:
        - compare_mqtt_timestamp:
  rules:
    - name: Button Long Press
      condition: event.action == "longPress" and event.timestamps.msg_age < 10
      action:
        run_job_template:
          name: Unconfigure Demo Environment
          organization: Meraki-Demo
    - name: Button Short Press
      condition: event.action == "shortPress" and event.timestamps.msg_age < 10
      action:
        run_job_template:
          name: Send Webex Teams Message
          organization: Meraki-Demo
          job_args:
            extra_vars:
              source_device: "demo-mt30"
              camera_name: "demo-mv2"
              webex_room_name: "WWT Ansible EDA Demo"

wwt.eda.bigpanda Usage

A sample rulebook using wwt.eda.bigpanda plugin is shown below:

---
- name: Remediate WWT-Demo Application
  hosts: all
  sources:
    - wwt.eda.bigpanda:
        api_token: <big-panda-api-token>
        environment: <big-panda-environment-name>
        delay: 10
  rules:
    - name: Restart Demo Application
      condition: >-
        event.alert.tags.alertname == "MainPageHTTPStatusNotOK" and
        event.alert.tags.event_action == "recreate"
      throttle:
        once_within: 5 minutes
        group_by_attributes:
          - event.incident.id
      action:
        run_job_template:
          name: Restart Demo App
          organization: Application-Demo
          job_args:
            extra_vars:
              deployment_name: "{{ event.alert.tags.container }}"
              k8s_namespace: "{{ event.alert.tags.app }}"

eda_collection's People

Contributors

kubealex avatar nsthompson avatar

Stargazers

 avatar  avatar

Watchers

 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.