52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
- name: Create app DB
|
|
ansible.builtin.include_role:
|
|
role: app/database
|
|
vars:
|
|
app_name: "n8n"
|
|
|
|
- name: Set up data folders on nfs share
|
|
ansible.builtin.include_role:
|
|
role: docker/container-data
|
|
vars:
|
|
dir_name: "n8n"
|
|
|
|
- name: Set facts
|
|
ansible.builtin.set_fact:
|
|
data_path: "{{ container_data_base_path }}/n8n"
|
|
|
|
- name: Create subdirectories
|
|
ansible.builtin.file:
|
|
dest: "{{ data_path }}/{{ item }}"
|
|
state: directory
|
|
mode: '0777'
|
|
loop:
|
|
- config
|
|
- files
|
|
|
|
- name: Deploy n8n container
|
|
community.docker.docker_container:
|
|
name: n8n
|
|
image: docker.n8n.io/n8nio/n8n
|
|
restart_policy: always
|
|
state: started
|
|
ports:
|
|
- "{{ port }}:5678"
|
|
env:
|
|
DOMAIN_NAME: "{{ domain }}"
|
|
SUBDOMAIN: "{{ subdomain }}"
|
|
N8N_HOST: "{{ subdomain }}.{{ domain }}"
|
|
N8N_PORT: "5678"
|
|
N8N_PROTOCOL: "https"
|
|
NODE_ENV: "production"
|
|
WEBHOOK_URL: "{{ subdomain }}.{{ domain }}"
|
|
GENERIC_TIMEZONE: "America/New_York"
|
|
DB_TYPE: "postgresdb"
|
|
DB_POSTGRESDB_HOST: "{{ pg_host }}"
|
|
DB_POSTGRESDB_PORT: "{{ pg_port | string }}"
|
|
DB_POSTGRESDB_DATABASE: "n8n"
|
|
DB_POSTGRESDB_USER: "n8n"
|
|
DB_POSTGRESDB_PASSWORD: "password"
|
|
N8N_RUNNERS_ENABLED: "true"
|
|
volumes:
|
|
- "{{ data_path }}/files:/files"
|
|
- "{{ data_path }}/config:/home/node/.n8n" |