forked from davestephens/ansible-nas
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ Add Heyform * 🚨 Fix lint
- Loading branch information
Showing
12 changed files
with
312 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -282,6 +282,10 @@ | |
tags: | ||
- hello_world | ||
|
||
- role: heyform | ||
tags: | ||
- heyform | ||
|
||
- role: homarr | ||
tags: | ||
- homarr | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
heyform_enabled: false | ||
heyform_available_externally: false | ||
|
||
# directories | ||
heyform_data_directory: "{{ docker_home }}/heyform" | ||
|
||
# network | ||
heyform_port: "8141" | ||
heyform_hostname: "heyform" | ||
heyform_network_name: "heyform" | ||
|
||
# specs | ||
heyform_memory: 1g | ||
heyform_mongo_memory: 1g | ||
heyform_redis_memory: 1g | ||
|
||
# docker | ||
heyform_container_name: heyform | ||
heyform_image_name: "heyform/community-edition" | ||
heyform_image_version: latest | ||
heyform_mongo_container_name: heyform-mongodb | ||
heyform_mongo_image_name: mongo | ||
heyform_mongo_image_version: 4.4.29 | ||
heyform_redis_container_name: heyform-redis | ||
heyform_redis_image_name: redis | ||
heyform_redis_image_version: latest | ||
heyform_user_id: "1000" | ||
heyform_group_id: "1000" | ||
|
||
|
||
# heyform | ||
heyform_mongo_initdb_root_username: "heyform" | ||
heyform_mongo_initdb_root_password: "heyform" | ||
heyform_app_homepage_url: "https://{{ heyform_hostname }}.{{ ansible_nas_domain }}" | ||
heyform_session_key: "key1" | ||
heyform_form_encryption_key: "key2" | ||
heyform_mongo_uri: "mongodb://{{ heyform_mongo_container_name }}:27017/heyform?authSource=admin" | ||
heyform_mongo_user: "{{ heyform_mongo_initdb_root_username }}" | ||
heyform_mongo_password: "{{ heyform_mongo_initdb_root_password }}" | ||
heyform_redis_host: "{{ heyform_redis_container_name }}" | ||
heyform_redis_port: "6379" | ||
heyform_app_disable_registration: "false" | ||
heyform_verify_user_email: "false" | ||
heyform_smtp_from: "" | ||
heyform_smtp_host: "" | ||
heyform_smtp_port: "" | ||
heyform_smtp_user: "" | ||
heyform_smtp_password: "" | ||
heyform_smtp_secure: "true" | ||
heyform_smtp_ignore_cert: "true" | ||
heyform_google_recaptcha_key: "" | ||
heyform_google_recaptcha_secret: "" | ||
heyform_apple_login_team_id: "" | ||
heyform_apple_login_web_client_id: "" | ||
heyform_apple_login_key_id: "" | ||
heyform_apple_login_private_key_path: "" | ||
heyform_google_login_client_id: "" | ||
heyform_google_login_client_secret: "" | ||
heyform_invite_code_expire_days: "" | ||
heyform_unsplash_client_id: "" | ||
heyform_openai_base_url: "" | ||
heyform_openai_api_key: "" | ||
heyform_openai_gpt_model: "" | ||
heyform_s3_endpoint: "" | ||
heyform_s3_region: "" | ||
heyform_s3_bucket: "" | ||
heyform_s3_access_key_id: "" | ||
heyform_s3_secret_access_key: "" | ||
heyform_s3_public_url: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Heyform | ||
|
||
Homepage: [https://github.com/heyform/heyform](https://github.com/heyform/heyform) | ||
|
||
HeyForm is an open-source form builder that allows anyone to create engaging conversational forms for surveys, questionnaires, quizzes, and polls. No coding skills required. | ||
|
||
## Usage | ||
|
||
Set `heyform_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file. | ||
|
||
heyform web interface can be found at [http://ansible_nas_host_or_ip:8141](http://ansible_nas_host_or_ip:8141). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
provisioner: | ||
inventory: | ||
group_vars: | ||
all: | ||
heyform_enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
heyform_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 heyform mongo container state | ||
community.docker.docker_container: | ||
name: "{{ heyform_mongo_container_name }}" | ||
register: result_mongo | ||
|
||
- name: Get heyform redis container state | ||
community.docker.docker_container: | ||
name: "{{ heyform_redis_container_name }}" | ||
register: result_redis | ||
|
||
- name: Get heyform container state | ||
community.docker.docker_container: | ||
name: "{{ heyform_container_name }}" | ||
register: result | ||
|
||
- name: Check if heyform containers are running | ||
ansible.builtin.assert: | ||
that: | ||
- result_mongo.container['State']['Status'] == "running" | ||
- result_mongo.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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 heyform mongo | ||
community.docker.docker_container: | ||
name: "{{ heyform_mongo_container_name }}" | ||
state: absent | ||
register: result_mongo | ||
|
||
- name: Try and stop and remove heyform redis | ||
community.docker.docker_container: | ||
name: "{{ heyform_redis_container_name }}" | ||
state: absent | ||
register: result_redis | ||
|
||
- name: Try and stop and remove heyform | ||
community.docker.docker_container: | ||
name: "{{ heyform_container_name }}" | ||
state: absent | ||
register: result | ||
|
||
- name: Check if heyform is stopped | ||
ansible.builtin.assert: | ||
that: | ||
- not result_mongo.changed | ||
- not result_redis.changed | ||
- not result.changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../requirements.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
--- | ||
- name: Start Heyform | ||
block: | ||
- name: Create Heyform Directories | ||
ansible.builtin.file: | ||
path: "{{ item }}" | ||
state: directory | ||
with_items: | ||
- "{{ heyform_data_directory }}" | ||
|
||
- name: Create Heyform network | ||
community.docker.docker_network: | ||
name: "{{ heyform_network_name }}" | ||
|
||
- name: Create Heyform Mongo Docker Container | ||
community.docker.docker_container: | ||
name: "{{ heyform_mongo_container_name }}" | ||
image: "{{ heyform_mongo_image_name }}:{{ heyform_mongo_image_version }}" | ||
pull: true | ||
volumes: | ||
- "{{ heyform_data_directory }}/database:/data/db:rw" | ||
networks: | ||
- name: "{{ heyform_network_name }}" | ||
network_mode: "{{ heyform_network_name }}" | ||
container_default_behavior: no_defaults | ||
env: | ||
MONGO_INITDB_ROOT_USERNAME: "{{ heyform_mongo_initdb_root_username }}" | ||
MONGO_INITDB_ROOT_PASSWORD: "{{ heyform_mongo_initdb_root_password }}" | ||
labels: | ||
traefik.enable: "false" | ||
restart_policy: always | ||
memory: "{{ heyform_mongo_memory }}" | ||
|
||
- name: Create Heyform Redis Docker Container | ||
community.docker.docker_container: | ||
name: "{{ heyform_redis_container_name }}" | ||
image: "{{ heyform_redis_image_name }}:{{ heyform_redis_image_version }}" | ||
pull: true | ||
volumes: | ||
- "{{ heyform_data_directory }}/redis:/data:rw" | ||
networks: | ||
- name: "{{ heyform_network_name }}" | ||
network_mode: "{{ heyform_network_name }}" | ||
container_default_behavior: no_defaults | ||
command: "redis-server --appendonly yes" | ||
labels: | ||
traefik.enable: "false" | ||
restart_policy: always | ||
memory: "{{ heyform_redis_memory }}" | ||
|
||
- name: Create Heyform Docker Container | ||
community.docker.docker_container: | ||
container_default_behavior: no_defaults | ||
name: "{{ heyform_container_name }}" | ||
image: "{{ heyform_image_name }}:{{ heyform_image_version }}" | ||
pull: true | ||
volumes: | ||
- "{{ heyform_data_directory }}/assets:/app/static/upload:rw" | ||
networks: | ||
- name: "{{ heyform_network_name }}" | ||
network_mode: "{{ heyform_network_name }}" | ||
ports: | ||
- "{{ heyform_port }}:8000" | ||
env: | ||
APP_HOMEPAGE_URL: "{{ heyform_app_homepage_url }}" | ||
APP_DISABLE_REGISTRATION: "{{ heyform_app_disable_registration }}" | ||
VERIFY_USER_EMAIL: "{{ heyform_verify_user_email }}" | ||
SESSION_KEY: "{{ heyform_session_key }}" | ||
FORM_ENCRYPTION_KEY: "{{ heyform_form_encryption_key }}" | ||
MONGO_URI: "{{ heyform_mongo_uri }}" | ||
MONGO_USER: "{{ heyform_mongo_user }}" | ||
MONGO_PASSWORD: "{{ heyform_mongo_password }}" | ||
REDIS_HOST: "{{ heyform_redis_host }}" | ||
REDIS_PORT: "{{ heyform_redis_port }}" | ||
SMTP_FROM: "{{ heyform_smtp_from }}" | ||
SMTP_HOST: "{{ heyform_smtp_host }}" | ||
SMTP_PORT: "{{ heyform_smtp_port }}" | ||
SMTP_USER: "{{ heyform_smtp_user }}" | ||
SMTP_PASSWORD: "{{ heyform_smtp_password }}" | ||
SMTP_SECURE: "{{ heyform_smtp_secure }}" | ||
SMTP_IGNORE_CERT: "{{ heyform_smtp_ignore_cert }}" | ||
GOOGLE_RECAPTCHA_KEY: "{{ heyform_google_recaptcha_key }}" | ||
GOOGLE_RECAPTCHA_SECRET: "{{ heyform_google_recaptcha_secret }}" | ||
APPLE_LOGIN_TEAM_ID: "{{ heyform_apple_login_team_id }}" | ||
APPLE_LOGIN_WEB_CLIENT_ID: "{{ heyform_apple_login_web_client_id }}" | ||
APPLE_LOGIN_KEY_ID: "{{ heyform_apple_login_key_id }}" | ||
APPLE_LOGIN_PRIVATE_KEY_PATH: "{{ heyform_apple_login_private_key_path }}" | ||
GOOGLE_LOGIN_CLIENT_ID: "{{ heyform_google_login_client_id }}" | ||
GOOGLE_LOGIN_CLIENT_SECRET: "{{ heyform_google_login_client_secret }}" | ||
INVITE_CODE_EXPIRE_DAYS: "{{ heyform_invite_code_expire_days }}" | ||
UNSPLASH_CLIENT_ID: "{{ heyform_unsplash_client_id }}" | ||
OPENAI_BASE_URL: "{{ heyform_openai_base_url }}" | ||
OPENAI_API_KEY: "{{ heyform_openai_api_key }}" | ||
OPENAI_GPT_MODEL: "{{ heyform_openai_gpt_model }}" | ||
S3_ENDPOINT: "{{ heyform_s3_endpoint }}" | ||
S3_REGION: "{{ heyform_s3_region }}" | ||
S3_BUCKET: "{{ heyform_s3_bucket }}" | ||
S3_ACCESS_KEY_ID: "{{ heyform_s3_access_key_id }}" | ||
S3_SECRET_ACCESS_KEY: "{{ heyform_s3_secret_access_key }}" | ||
S3_PUBLIC_URL: "{{ heyform_s3_public_url }}" | ||
restart_policy: unless-stopped | ||
memory: "{{ heyform_memory }}" | ||
labels: | ||
traefik.enable: "{{ heyform_available_externally | string }}" | ||
traefik.http.routers.heyform.rule: "Host(`{{ heyform_hostname }}.{{ ansible_nas_domain }}`)" | ||
traefik.http.routers.heyform.tls.certresolver: "letsencrypt" | ||
traefik.http.routers.heyform.tls.domains[0].main: "{{ ansible_nas_domain }}" | ||
traefik.http.routers.heyform.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" | ||
traefik.http.services.heyform.loadbalancer.server.port: "8000" | ||
when: heyform_enabled is true | ||
|
||
- name: Stop Heyform | ||
block: | ||
- name: Stop Heyform Mongo | ||
community.docker.docker_container: | ||
name: "{{ heyform_mongo_container_name }}" | ||
state: absent | ||
|
||
- name: Stop Heyform Redis | ||
community.docker.docker_container: | ||
name: "{{ heyform_redis_container_name }}" | ||
state: absent | ||
|
||
- name: Stop Heyform | ||
community.docker.docker_container: | ||
name: "{{ heyform_container_name }}" | ||
state: absent | ||
when: heyform_enabled is false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: "Heyform" | ||
description: "HeyForm is an open-source form builder that allows anyone to create engaging conversational forms for surveys, questionnaires, quizzes, and polls. No coding skills required." | ||
--- | ||
|
||
Homepage: [https://github.com/heyform/heyform](https://github.com/heyform/heyform) | ||
|
||
HeyForm is an open-source form builder that allows anyone to create engaging conversational forms for surveys, questionnaires, quizzes, and polls. No coding skills required. | ||
|
||
## Usage | ||
|
||
Set `heyform_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file. | ||
|
||
heyform web interface can be found at [http://ansible_nas_host_or_ip:8141](http://ansible_nas_host_or_ip:8141). |