Added: Chat Server web fronted app installed
This commit is contained in:
parent
ab7e5d9a47
commit
f632971d1c
2 changed files with 126 additions and 19 deletions
|
|
@ -52,22 +52,44 @@
|
||||||
- nginx
|
- nginx
|
||||||
- ejabberd
|
- ejabberd
|
||||||
- git
|
- git
|
||||||
|
- python3-certbot-nginx
|
||||||
|
- python3-psycopg2
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Cloning Movim
|
- name: Installing Movim App
|
||||||
ansible.builtin.git:
|
block:
|
||||||
repo: https://github.com/movim/movim.git
|
- name: Cloning
|
||||||
dest: "{{ movim.path }}"
|
ansible.builtin.git:
|
||||||
version: "{{ movim.version }}"
|
repo: https://github.com/movim/movim.git
|
||||||
|
dest: "{{ movim.path }}"
|
||||||
- name: Setting Mode and Ownershp
|
version: "{{ movim.version }}"
|
||||||
ansible.builtin.file:
|
rescue:
|
||||||
path: "{{ movim.path }}"
|
- name: Fetching
|
||||||
state: directory
|
ansible.builtin.command:
|
||||||
owner: "{{ www.user }}"
|
argv:
|
||||||
group: "{{ www.group }}"
|
- git
|
||||||
recurse: true
|
- fetch
|
||||||
mode: "755"
|
chdir: "{{ movim.path }}"
|
||||||
|
become: true
|
||||||
|
become_user: "{{ www.user }}"
|
||||||
|
- name: Checking Out
|
||||||
|
ansible.builtin.command:
|
||||||
|
argv:
|
||||||
|
- git
|
||||||
|
- checkout
|
||||||
|
- "{{ movim.version }}"
|
||||||
|
chdir: "{{ movim.path }}"
|
||||||
|
become: true
|
||||||
|
become_user: "{{ www.user }}"
|
||||||
|
always:
|
||||||
|
- name: Setting Mode and Ownershp
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ movim.path }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ www.user }}"
|
||||||
|
group: "{{ www.group }}"
|
||||||
|
recurse: true
|
||||||
|
mode: "755"
|
||||||
|
|
||||||
- name: Installing Movim dependanciens
|
- name: Installing Movim dependanciens
|
||||||
community.general.composer:
|
community.general.composer:
|
||||||
|
|
@ -76,7 +98,90 @@
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ www.user }}"
|
become_user: "{{ www.user }}"
|
||||||
|
|
||||||
- name: Cleaning up
|
- name: Create Database User
|
||||||
ansible.builtin.package:
|
community.postgresql.postgresql_user:
|
||||||
name: git
|
user: movim
|
||||||
state: absent
|
password: movim
|
||||||
|
state: present
|
||||||
|
become_user: "{{ postgres.user }}"
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Create Database
|
||||||
|
community.postgresql.postgresql_db:
|
||||||
|
name: movim
|
||||||
|
owner: movim
|
||||||
|
state: present
|
||||||
|
become_user: "{{ postgres.user }}"
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Setting-Up Movim execution environment
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ movim.path }}/.env"
|
||||||
|
block: |
|
||||||
|
# Database configuration
|
||||||
|
DB_DRIVER=pgsql
|
||||||
|
DB_HOST=127.0.0.1
|
||||||
|
DB_PORT=5432
|
||||||
|
DB_DATABASE=movim
|
||||||
|
DB_USERNAME=movim
|
||||||
|
DB_PASSWORD=movim
|
||||||
|
|
||||||
|
# Daemon configuration
|
||||||
|
DAEMON_URL=https://chat.trans13nrv.eu.org/ # Public URL of your Movim instance
|
||||||
|
DAEMON_PORT=8080 # Port on which the daemon will listen
|
||||||
|
DAEMON_INTERFACE=127.0.0.1 # Interface on which the daemon will listen, must be an IP
|
||||||
|
DAEMON_DEBUG=false
|
||||||
|
DAEMON_VERBOSE=false
|
||||||
|
|
||||||
|
owner: "{{ www.user }}"
|
||||||
|
group: "{{ www.group }}"
|
||||||
|
create: true
|
||||||
|
mode: "600"
|
||||||
|
|
||||||
|
- name: Migrating Database
|
||||||
|
community.general.composer:
|
||||||
|
command: "movim:migrate"
|
||||||
|
working_dir: "{{ movim.path }}"
|
||||||
|
become: true
|
||||||
|
become_user: "{{ www.user }}"
|
||||||
|
|
||||||
|
- name: Setting-Up Movim demon service
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: /etc/systemd/system/movim.service
|
||||||
|
block: |
|
||||||
|
[Unit]
|
||||||
|
Description=Movim daemon
|
||||||
|
After=nginx.service network.target local-fs.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=www-data
|
||||||
|
Type=simple
|
||||||
|
Environment=PUBLIC_URL=https://chat.trans13nrv.eu.org/
|
||||||
|
Environment=WS_PORT=8080
|
||||||
|
EnvironmentFile=-/etc/default/movim
|
||||||
|
ExecStart=/usr/bin/php daemon.php start
|
||||||
|
WorkingDirectory={{ movim.path }}
|
||||||
|
StandardOutput=syslog
|
||||||
|
SyslogIdentifier=movim
|
||||||
|
PIDFile=/run/movim.pid
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=10
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
owner: "{{ root.user }}"
|
||||||
|
group: "{{ root.group }}"
|
||||||
|
mode: "644"
|
||||||
|
create: true
|
||||||
|
|
||||||
|
- name: Reload SystemD daemon
|
||||||
|
ansible.builtin.command:
|
||||||
|
argv:
|
||||||
|
- systemctl
|
||||||
|
- daemon-reload
|
||||||
|
|
||||||
|
- name: Enable and start Movim Damon Service
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
service: movim.service
|
||||||
|
enabled: true
|
||||||
|
state: started
|
||||||
|
|
|
||||||
|
|
@ -16,4 +16,6 @@ www:
|
||||||
group: www-data
|
group: www-data
|
||||||
movim:
|
movim:
|
||||||
version: v0.24.1
|
version: v0.24.1
|
||||||
path: /var/www/chat.trans13nrv.eu.org
|
path: /var/www/chat.trans13nrv.eu.org
|
||||||
|
postgres:
|
||||||
|
user: postgres
|
||||||
Loading…
Add table
Add a link
Reference in a new issue