deploy gancio

This commit is contained in:
les 2020-11-12 15:07:15 +01:00
parent 0df3ccd54a
commit 6b3c732ec2
9 changed files with 78 additions and 31 deletions

View file

@ -1,13 +1,13 @@
---
## ETHERPAD
# - name: Etherpad
# hosts: paddone
# roles:
# - role: stable/common
# - role: stable/etherpad
# vars_files:
# - vars/etherpad.yml
- name: Etherpad
hosts: paddone
roles:
- role: stable/common
- role: stable/etherpad
vars_files:
- vars/etherpad.yml
## CICLES
@ -16,3 +16,16 @@
roles:
- role: stable/common
- role: stable/goploader
## GANCIO
- name: Gancio
hosts: gancio
roles:
- role: stable/common
- role: stable/gancio
vars_files:
- vars/gancio.yml
## MASTODON

View file

@ -4,6 +4,9 @@ paddone:
cicles:
hosts: 192.168.199.105
gancio:
hosts: 192.168.199.106
all:
vars:
passwordstore_path: cisti.org/ansible

View file

@ -1,2 +0,0 @@
database_password: "{{lookup('password', './.pass/gancio_db_password')}}"

View file

@ -1,21 +0,0 @@
---
dependencies:
# install nodejs
- role: nodejs
# install postgres
# and create an etherpad user and db
- role: postgresql
vars:
username: gancio
password: "{{ database_password }}"
database: gancio
# install caddy and configure it as reverse proxy
- role: caddy
vars:
caddy_config: |
{{hostname}}
encode gzip
reverse_proxy localhost:31337

View file

@ -0,0 +1,7 @@
---
title: "Gancio"
listen_ip: "0.0.0.0"
listen_port: "13120"
url: "http://localhost:13120"
database_password: "{{lookup('community.general.passwordstore', '{{passwordstore_path}}/gancio/db_password create=True nosymbols=true')}}"

View file

@ -0,0 +1,13 @@
---
dependencies:
# install nodejs
- role: nodejs
# install postgres
# and create an gancio user and db
- role: postgresql
vars:
username: gancio
password: "{{ database_password }}"
database: gancio

View file

@ -16,15 +16,24 @@
- name: NODE | Install gancio
npm:
executable: /usr/bin/npm --unsafe-perm=true --allow-root
name: gancio
global: yes
production: yes
state: present
- name: Copy settings
template:
src: config.json.j2
dest: /srv/gancio/config.json
owner: gancio
group: gancio
mode: 0660
- name: NODE | Start APP
become: true
become_user: gancio
shell: pm2 start gancio start --db="postgres"
shell: pm2 start gancio -- start --config config.json
args:
chdir: /srv/gancio
ignore_errors: yes

View file

@ -0,0 +1,23 @@
{
"title": "{{title}}",
"baseurl": "{{url}}",
"server": {
"host": "{{listen_ip}}",
"port": {{listen_port}}
},
"db": {
"dialect": "postgres",
"host": "/var/run/postgresql",
"database": "gancio",
"username": "gancio",
"password": "{{database_password}}",
"logging": false
},
"upload_path": "/srv/gancio/uploads",
"smtp": {
"sendmail": true,
"newline": "unix",
"path": "/usr/sbin/sendmail"
},
"secret": "{{lookup('community.general.passwordstore', '{{passwordstore_path}}/gancio/session_secret create=True nosymbols=true')}}"
}

2
vars/gancio.yml Normal file
View file

@ -0,0 +1,2 @@
---
url: "https://g.cisti.org"