Skip to content

Commit

Permalink
✨ Add Activepieces
Browse files Browse the repository at this point in the history
  • Loading branch information
anarion80 committed Dec 14, 2023
1 parent 2a275ca commit 2246ecb
Show file tree
Hide file tree
Showing 10 changed files with 306 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ If you have a spare domain name you can configure applications to be accessible

## Available Applications

* [Activepieces](https://www.activepieces.com/) - an open source all-in-one automation tool
* [Admidio](https://www.admidio.org/) - a free online membership management
* [Airsonic](https://airsonic.github.io/) - catalog and stream music
* [Authelia](https://www.authelia.com/) - The Single Sign-On Multi-Factor portal for web apps
Expand Down
4 changes: 4 additions & 0 deletions nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
###
### Applications
###
- role: activepieces
tags:
- activepieces

- role: admidio
tags:
- admidio
Expand Down
56 changes: 56 additions & 0 deletions roles/activepieces/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
activepieces_enabled: false
activepieces_available_externally: false

# directories
activepieces_data_directory: "{{ docker_home }}/activepieces"

# network
activepieces_port: "8129"
activepieces_hostname: "activepieces"
activepieces_network_name: "activepieces"

# specs
activepieces_memory: 1g
activepieces_db_memory: 1g
activepieces_redis_memory: 1g

# docker
activepieces_container_name: activepieces
activepieces_image_name: "activepieces/activepieces"
activepieces_image_version: "0.14.3"
activepieces_db_container_name: activepieces-db
activepieces_db_image_name: "postgres"
activepieces_db_image_version: "14.4"
activepieces_redis_container_name: activepieces-redis
activepieces_redis_image_name: "redis"
activepieces_redis_image_version: "7.0.7"
activepieces_user_id: "1000"
activepieces_group_id: "1000"

activepieces_admin_username: "admin"
activepieces_admin_password: "admin"
activepieces_db_name: "activepieces"
activepieces_db_user: "activepieces"
activepieces_db_pass: "activepieces"

# activepieces
activepieces_engine_executable_path: "dist/packages/engine/main.js"
activepieces_api_key: ""
activepieces_encryption_key: "7e19fad4c13eaea8f757afb12e8f9c41"
activepieces_jwt_secret: "super-secret"
activepieces_environment: "prod"
activepieces_frontend_url: "https://{{ activepieces_hostname }}.{{ ansible_nas_domain }}"
activepieces_webhook_timeout_seconds: "30"
activepieces_trigger_default_poll_interval: "5"
activepieces_postgres_database: "{{ activepieces_db_name }}"
activepieces_postgres_host: "{{ activepieces_db_container_name }}"
activepieces_postgres_port: "5432"
activepieces_postgres_username: "{{ activepieces_db_user }}"
activepieces_postgres_password: "{{ activepieces_db_pass }}"
activepieces_execution_mode: "UNSANDBOXED"
activepieces_redis_host: "{{ activepieces_redis_container_name }}"
activepieces_redis_port: "6379"
activepieces_sandbox_run_time_seconds: "600"
activepieces_telemetry_enabled: "false"
activepieces_templates_source_url: "https://cloud.activepieces.com/api/v1/flow-templates"
11 changes: 11 additions & 0 deletions roles/activepieces/docs/activepieces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Activepieces

Homepage: <https://www.activepieces.com/>

Your friendliest open source all-in-one automation tool ✨ Workflow automation tool 100+ integration / Enterprise automation tool / ChatBot / Zapier Alternative

## Usage

Set `activepieces_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.

activepieces web interface can be found at <http://ansible_nas_host_or_ip:8129>.
16 changes: 16 additions & 0 deletions roles/activepieces/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
platforms:
- name: instance
image: geerlingguy/docker-ubuntu2204-ansible:latest
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /var/run/docker.sock:/var/run/docker.sock
- /tmp:/tmp:rw
privileged: true
pre_build_image: true
provisioner:
inventory:
group_vars:
all:
activepieces_enabled: true
activepieces_data_directory: /tmp
10 changes: 10 additions & 0 deletions roles/activepieces/molecule/default/side_effect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
activepieces_enabled: false
33 changes: 33 additions & 0 deletions roles/activepieces/molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Get activepieces db container state
community.docker.docker_container:
name: "{{ activepieces_db_container_name }}"
register: result_db

- name: Get activepieces redis container state
community.docker.docker_container:
name: "{{ activepieces_db_container_name }}"
register: result_redis

- name: Get activepieces container state
community.docker.docker_container:
name: "{{ activepieces_container_name }}"
register: result

- name: Check if activepieces containers are running
ansible.builtin.assert:
that:
- result_db.container['State']['Status'] == "running"
- result_db.container['State']['Restarting'] == false
- result_redis.container['State']['Status'] == "running"
- result_redis.container['State']['Restarting'] == false
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false
33 changes: 33 additions & 0 deletions roles/activepieces/molecule/default/verify_stopped.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Try and stop and remove activepieces
community.docker.docker_container:
name: "{{ activepieces_container_name }}"
state: absent
register: result

- name: Try and stop and remove activepieces redis
community.docker.docker_container:
name: "{{ activepieces_db_container_name }}"
state: absent
register: result_redis

- name: Try and stop and remove activepieces db
community.docker.docker_container:
name: "{{ activepieces_db_container_name }}"
state: absent
register: result_db

- name: Check if activepieces is stopped
ansible.builtin.assert:
that:
- not result.changed
- not result_redis.changed
- not result_db.changed
128 changes: 128 additions & 0 deletions roles/activepieces/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
- name: Start Activepieces
block:
- name: Create Activepieces Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ activepieces_data_directory }}"
- "{{ activepieces_data_directory }}/config"

- name: Create Activepieces network
community.docker.docker_network:
name: "{{ activepieces_network_name }}"

- name: Create Activepieces Postgress Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ activepieces_db_container_name }}"
image: "{{ activepieces_db_image_name }}:{{ activepieces_db_image_version }}"
pull: true
volumes:
- "{{ activepieces_data_directory }}/db:/var/lib/postgresql/data:rw"
networks:
- name: "{{ activepieces_network_name }}"
network_mode: "{{ activepieces_network_name }}"
env:
POSTGRES_PASSWORD: "{{ activepieces_db_pass }}"
POSTGRES_USER: "{{ activepieces_db_user }}"
POSTGRES_DB: "{{ activepieces_db_name }}"
labels:
traefik.enable: "false"
restart_policy: always
memory: "{{ activepieces_db_memory }}"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U activepieces"]
start_period: 20s
interval: 5s
retries: 12
timeout: 5s

- name: Create Activepieces Redis Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ activepieces_redis_container_name }}"
image: "{{ activepieces_redis_image_name }}:{{ activepieces_redis_image_version }}"
pull: true
volumes:
- "{{ activepieces_data_directory }}/redis:/data:rw"
networks:
- name: "{{ activepieces_network_name }}"
network_mode: "{{ activepieces_network_name }}"
labels:
traefik.enable: "false"
restart_policy: always
memory: "{{ activepieces_redis_memory }}"

- name: Create Activepieces Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ activepieces_container_name }}"
image: "{{ activepieces_image_name }}:{{ activepieces_image_version }}"
pull: true
networks:
- name: "{{ activepieces_network_name }}"
network_mode: "{{ activepieces_network_name }}"
volumes:
- "{{ activepieces_data_directory }}/config/config.toml:/activepieces/config.toml"
ports:
- "{{ activepieces_port }}:80"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ activepieces_user_id | quote }}"
PGID: "{{ activepieces_group_id | quote }}"
## It's advisable to consult the documentation and use the tools/deploy.sh to generate the passwords, keys, instead of manually filling them.

AP_ENGINE_EXECUTABLE_PATH: "{{ activepieces_engine_executable_path }}"

## Random Long Password (Optional for community edition)
AP_API_KEY: "{{ activepieces_api_key }}"

## 256 bit encryption key, 32 hex character
AP_ENCRYPTION_KEY: "{{ activepieces_encryption_key }}"

## JWT Secret
AP_JWT_SECRET: "{{ activepieces_jwt_secret }}"

AP_ENVIRONMENT: "{{ activepieces_environment }}"
AP_FRONTEND_URL: "{{ activepieces_frontend_url }}"
AP_WEBHOOK_TIMEOUT_SECONDS: "{{ activepieces_webhook_timeout_seconds }}"
AP_TRIGGER_DEFAULT_POLL_INTERVAL: "{{ activepieces_trigger_default_poll_interval }}"
AP_POSTGRES_DATABASE: "{{ activepieces_postgres_database }}"
AP_POSTGRES_HOST: "{{ activepieces_postgres_host }}"
AP_POSTGRES_PORT: "{{ activepieces_postgres_port }}"
AP_POSTGRES_USERNAME: "{{ activepieces_postgres_username }}"
AP_POSTGRES_PASSWORD: "{{ activepieces_postgres_password }}"
AP_EXECUTION_MODE: "{{ activepieces_execution_mode }}"
AP_REDIS_HOST: "{{ activepieces_redis_host }}"
AP_REDIS_PORT: "{{ activepieces_redis_port }}"
AP_SANDBOX_RUN_TIME_SECONDS: "{{ activepieces_sandbox_run_time_seconds }}"
AP_TELEMETRY_ENABLED: "{{ activepieces_telemetry_enabled }}"
AP_TEMPLATES_SOURCE_URL: "{{ activepieces_templates_source_url }}"
restart_policy: unless-stopped
memory: "{{ activepieces_memory }}"
labels:
traefik.enable: "{{ activepieces_available_externally | string }}"
traefik.http.routers.activepieces.rule: "Host(`{{ activepieces_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.activepieces.tls.certresolver: "letsencrypt"
traefik.http.routers.activepieces.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.activepieces.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.activepieces.loadbalancer.server.port: "80"
when: activepieces_enabled is true

- name: Stop Activepieces
block:
- name: Stop Activepieces
community.docker.docker_container:
name: "{{ activepieces_container_name }}"
state: absent
- name: Stop Activepieces Redis
community.docker.docker_container:
name: "{{ activepieces_redis_container_name }}"
state: absent
- name: Stop Activepieces DB
community.docker.docker_container:
name: "{{ activepieces_db_container_name }}"
state: absent
when: activepieces_enabled is false
14 changes: 14 additions & 0 deletions website/docs/applications/other/activepieces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Activepieces"
description: "An open source all-in-one automation tool"
---

Homepage: <https://www.activepieces.com/>

Your friendliest open source all-in-one automation tool ✨ Workflow automation tool 100+ integration / Enterprise automation tool / ChatBot / Zapier Alternative

## Usage

Set `activepieces_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.

activepieces web interface can be found at <http://ansible_nas_host_or_ip:8129>.

0 comments on commit 2246ecb

Please sign in to comment.