# lsa.n8n Ansible role to deploy and manage n8n with Docker, repo, or package installs. ## Variables ### n8n_sites Define one or more n8n instances. Each entry requires `name` and `deploy_type`. Supported `deploy_type` values: - `docker` (Docker Compose) - `repo` (clone and build from git) - `package` (global npm package) ### Database options Database settings follow the same pattern as `lsa.umami` using a `db` map per site. Supported `db.type` values: `postgres`, `mysql`, `mariadb`. Example DB block: ```yaml n8n_sites: - name: "n8n" deploy_type: "package" db: host: "127.0.0.1" port: 5432 name: "n8n" user: "n8n" password: "secret" type: "postgres" ``` Example (package): ```yaml n8n_sites: - name: "n8n" deploy_type: "package" path: "/srv/n8n" systemd: true app_options: host: "n8n.example.com" port: 5678 protocol: "https" ``` Example (repo): ```yaml n8n_sites: - name: "n8n-repo" deploy_type: "repo" path: "/srv/n8n-repo" systemd: true app_options: repo_path: "https://github.com/n8n-io/n8n.git" repo_version: "master" build_command: "pnpm build" start_command: "pnpm start" ``` Example (docker): ```yaml n8n_sites: - name: "n8n-docker" deploy_type: "docker" path: "/srv/n8n-docker" systemd: true docker_options: image: "n8nio/n8n:latest" listen_port: 5678 uid: "1000" gid: "1000" app_options: host: "n8n.example.com" protocol: "https" ``` ## Notes - Package/repo deployments assume Node.js and npm are already installed; repo uses pnpm. - The role writes instance facts to `/etc/ansible/facts.d/`.