Merge pull request #382 from Narcolapser/n8n_role

N8n role
This commit is contained in:
David Stephens 2021-01-28 08:59:07 +00:00 committed by GitHub
commit 2372356a8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 66 additions and 0 deletions

View file

@ -61,6 +61,7 @@ Ansible config and a bunch of Docker containers.
* [Mosquitto](https://mosquitto.org) - An open source MQTT broker * [Mosquitto](https://mosquitto.org) - An open source MQTT broker
* [Mylar](https://github.com/evilhero/mylar) - An automated Comic Book downloader (cbr/cbz) for use with SABnzbd, NZBGet and torrents * [Mylar](https://github.com/evilhero/mylar) - An automated Comic Book downloader (cbr/cbz) for use with SABnzbd, NZBGet and torrents
* [MyMediaForAlexa](https://www.mymediaalexa.com/) - Lets you stream your music collection to your alexa device * [MyMediaForAlexa](https://www.mymediaalexa.com/) - Lets you stream your music collection to your alexa device
* [n8n](https://n8n.io") - Nodemation, a node based workflow and automation service like IFTTT.
* [Netdata](https://my-netdata.io/) - An extremely comprehensive system monitoring solution * [Netdata](https://my-netdata.io/) - An extremely comprehensive system monitoring solution
* [Nextcloud](https://nextcloud.com/) - A self-hosted Dropbox alternative * [Nextcloud](https://nextcloud.com/) - A self-hosted Dropbox alternative
* [NZBget](https://nzbget.net/) - The most efficient usenet downloader * [NZBget](https://nzbget.net/) - The most efficient usenet downloader

14
docs/applications/n8n.md Normal file
View file

@ -0,0 +1,14 @@
# Nodemation (n8n)
Homepage: [ihttps://n8n.io](https://n8n.io)
## Usage
Set `n8n_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
n8n is secured by default, he user and password can be set with:
* n8n_basic_auth_user: "<user name>"
* n8n_basic_auth_password: "<user password>"
The default for these is "n8n_user" and "n8n_change_me" respectively, it is recommended to change these.

View file

@ -39,6 +39,7 @@ By default, applications can be found on the ports listed below.
| Mosquitto | 9001 | Websocket | | Mosquitto | 9001 | Websocket |
| Mylar | 8585 | HTTP | | Mylar | 8585 | HTTP |
| MyMediaForAlexa | 52051 | | | MyMediaForAlexa | 52051 | |
| n8n | 5678 | HTTP |
| Netdata | 19999 | | | Netdata | 19999 | |
| Nextcloud | 8080 | | | Nextcloud | 8080 | |
| NZBGet | 6789 | | | NZBGet | 6789 | |

View file

@ -98,6 +98,11 @@
- lidarr - lidarr
when: (lidarr_enabled | default(False)) when: (lidarr_enabled | default(False))
- role: n8n
tags:
- n8n_enabled
when: (n8n_enabled | default(False))
- role: netdata - role: netdata
tags: tags:
- netdata - netdata

View file

@ -0,0 +1,14 @@
n8n_enabled: false
# Networking
n8n_available_externally: "false"
n8n_port: 5678
n8n_hostname: "n8n"
# Directories
n8n_data_directory: "{{ docker_home }}/n8n"
# Security
n8n_basic_auth_user: "n8n_user"
n8n_basic_auth_password: "n8n_change_me"

31
roles/n8n/tasks/main.yml Normal file
View file

@ -0,0 +1,31 @@
---
- name: Create n8n Directory
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ n8n_data_directory }}"
- name: n8n Docker Container
docker_container:
name: n8n
image: n8nio/n8n
pull: true
ports:
- "{{ n8n_port }}:5678"
volumes:
- "{{ n8n_data_directory }}:/home/node/.n8n:rw"
- "/etc/timezone:/etc/timezone:ro"
restart_policy: unless-stopped
memory: 1g
env:
N8N_BASIC_AUTH_ACTIVE: "true"
N8N_BASIC_AUTH_USER: "{{ n8n_basic_auth_user }}"
N8N_BASIC_AUTH_PASSWORD: "{{ n8n_basic_auth_password }}"
labels:
traefik.enable: "{{ n8n_available_externally }}"
traefik.http.routers.n8n.rule: "Host(`{{ n8n_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.n8n.tls.certresolver: "letsencrypt"
traefik.http.routers.n8n.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.n8n.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.gitea.loadbalancer.server.port: "5678"