working ansible role???

This commit is contained in:
sneakers-the-rat 2023-08-07 16:45:44 -07:00
parent d43add046d
commit 0e8b30d081
6 changed files with 18 additions and 6 deletions

View file

@ -23,7 +23,7 @@ chatbridge_admin_token: CHANGEME
chatbridge_postgres_user: chatbridge
chatbridge_postgres_password: CHANGEME
chatbridge_postgres_db: chatbridge
chatbridge_postgres_port: 6500
chatbridge_postgres_port: 5432
# slack config
chatbridge_slack_client_id: CHANGEME

View file

@ -39,7 +39,7 @@
copy:
remote_src: true
src: "{{ chatbridge_user_home }}/chatbridge/client/dist/"
dest: "{{ chatbridge_public_dir }}"
dest: "/var/www/html{{ chatbridge_webroot }}"

View file

@ -5,6 +5,18 @@
src: chatbridge_env.j2
dest: "{{ chatbridge_user_home}}/chatbridge/server/.env"
mode: "600"
when:
- CHATBRIDGE_MODE == 'development'
- name: create production .env
become: yes
become_user: "{{ chatbridge_user }}"
template:
src: chatbridge_env.j2
dest: "{{ chatbridge_user_home}}/chatbridge/server/dist/.env"
mode: "600"
when:
- CHATBRIDGE_MODE == 'production'
- name: create https nginx config
become: yes

View file

@ -13,4 +13,3 @@
get_url:
url: "{{ item.browser_download_url }}"
dest: "{{ chatbridge_matterbridge_binary }}"
creates: "{{ chatbridge_matterbridge_binary }}"

View file

@ -16,7 +16,8 @@ server {
location {{ chatbridge_webroot }} {
root {{ chatbridge_public_dir }};
try_files $uri $uri/ $uri/index.html /index.html index.html;
index index.html;
try_files $uri $uri/ $uri/index.html =404;
}
{% endif %}

View file

@ -2,13 +2,13 @@
Description=Chatbridge
[Service]
ExecStart=/usr/local/bin/node {{ chatbridge_user_home }}/chatbridge/server/dist/src/app.js
ExecStart=/usr/bin/node {{ chatbridge_user_home }}/chatbridge/server/dist/src/app.js
Restart=always
User={{ chatbridge_user }}
Group=nogroup
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory={{ chatbridge_user_home }}/chatbridge/server/dist/src/
WorkingDirectory={{ chatbridge_user_home }}/chatbridge/server/dist/
[Install]
WantedBy=multi-user.target