Code Monkey home page Code Monkey logo

kubealex.eda's Introduction

Event Driven Automation Collection - kubealex.eda

This collection was born with the idea to group some plugins and resources that can be helpful in extending the Event Driven Automation collection.

Roles

The following roles are included in the collection

Name Description
kubealex.eda.role_eda_controller_setup Configure Projects, DE, Rulebook Activations

Usage

---
- name: Sample EDA Controller Setup
  hosts: localhost
  gather_facts: false

  roles:

  - role: role_eda_controller_setup
    vars:
    eda_controller_url: "https://your-eda-controller-api.com"
    eda_controller_user: "your_eda_user"
    eda_controller_password: "your_eda_password"
    eda_projects: - name: "EDA Demo Project"
    git_url: "https://github.com/kubealex/event-driven-automation"
    description: "Demo project to show EDA in action"
    eda_decision_env: - name: "kubealex-eda"
    image_url: "quay.io/kubealex/eda-decision-env"
    eda_activations: - name: "eda-alertmanager"
    rulebook: "eda-rulebook-alertmanager.yml"
    project_name: EDA Demo Project
    decision_env: Automation Hub Default Decision Environment

Plugins

The following plugins are included in the collection

Name Description
kubealex.eda.mqtt Configure MQTT listener for events

Usage

A sample rulebook using kubealex.eda.mqtt plugin is shown below

---
- name: Hello Events
  hosts: all
  sources:
    - kubealex.eda.mqtt:
        host: localhost
        port: 1883
        topic: anomaly-data-out
  rules:
    - name: Debug connection
      condition: event.sensor_location is defined
      action:
        debug:

Modules

The following modules are included in the collection

Name Description
kubealex.eda.eda_activations Configure activations in EDA Controller
kubealex.eda.eda_credentials Configure credentials in EDA Controller
kubealex.eda.eda_decision_environment Configure decision_environments in EDA Controller
kubealex.eda.eda_projects Configure projects in EDA Controller

Usage

A sample playbook to create items using the modules is shown below:

---
- name: Example Playbook
  hosts: localhost
  tasks:
    - name: Create EDA Activations
      kubealex.eda.eda_activations:
        controller_url: "https://example-controller.com"
        controller_user: "admin"
        controller_password: "admin123"
        activations:
          - name: Activation 1
            project_name: Project 1
            rulebook: Rulebook 1
            extra_vars: {}
            restart_policy: always
            enabled: true
            decision_env: Decision Environment 1
          - name: Activation 2
            project_name: Project 2
            rulebook: Rulebook 2
            extra_vars: {}
            restart_policy: always
            enabled: true
            decision_env: Decision Environment 2

    - name: Create EDA Decision Environments
      kubealex.eda.eda_decision_environment:
        controller_url: "https://example-controller.com"
        controller_user: "admin"
        controller_password: "admin123"
        decision_envs:
          - name: Decision Environment 1
            image_url: "http://example.com/decision_env1"
          - name: Decision Environment 2
            image_url: "http://example.com/decision_env2"

    - name: Create EDA Credentials
      kubealex.eda.eda_credentials:
        controller_url: "https://example-controller.com"
        controller_user: "admin"
        controller_password: "admin123"
        credentials:
          - name: Credential 1
            description: "Credential 1 description"
            username: "user1"
            secret: "secret1"
            credential_type: "GitHub Personal Access Token"
          - name: Credential 2
            description: "Credential 2 description"
            username: "user2"
            secret: "secret2"
            credential_type: "GitLab Personal Access Token"

    - name: Create EDA Projects
      kubealex.eda.eda_projects:
        controller_url: "https://example-controller.com"
        controller_user: "admin"
        controller_password: "admin123"
        projects:
          - project_name: Project 1
            project_description: "Project 1 description"
            project_git_url: "http://example.com/project1"
            project_credential: "Credential 1"
          - project_name: Project 2
            project_description: "Project 2 description"
            project_git_url: "http://example.com/project2"
            project_credential: "Credential 2"

kubealex.eda's People

Contributors

jpmens avatar kubealex avatar mihaipuha avatar nsthompson avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jpmens puhamihai

kubealex.eda's Issues

mqtt event source seems to be using deprecated connection methods

I ran pip install aiomqtt and got aiomqtt-1.2.1 installed which, when used from the mqtt event source reports:

2023-10-01 09:42:51,286 - mqtt - WARNING - The manual `connect` and `disconnect` methods are deprecated and will be removed in a future version. The preferred way to connect and disconnect the client is to use the context manager interface via `async with`. In case your use case needs to connect and disconnect manually, you can call the context manager's `__aenter__` and `__aexit__` methods as an escape hatch instead. `__aenter__` is equivalent to `connect`. `__aexit__` is equivalent to `disconnect` except that it forces disconnection instead of throwing an exception in case the client cannot disconnect cleanly. `__aexit__` expects three arguments: `exc_type`, `exc`, and `tb`. These arguments describe the exception that caused the context manager to exit, if any. You can pass `None` to all of these arguments in a manual call to `__aexit__`.

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.