63 lines
1.8 KiB
YAML
63 lines
1.8 KiB
YAML
---
|
|
- name: Install keanu weblite
|
|
hosts: all
|
|
become: true
|
|
tasks:
|
|
- name: Install Node.js 22 (needed for matrix-js-sdk)
|
|
ansible.builtin.shell: |
|
|
set -o pipefail curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
|
apt-get install -y nodejs
|
|
args:
|
|
executable: /bin/bash
|
|
creates: /bin/npm
|
|
|
|
- name: Ensure previous keanu-weblite temp directory is removed
|
|
ansible.builtin.file:
|
|
path: /tmp/keanu-weblite
|
|
state: absent
|
|
delegate_to: localhost
|
|
|
|
- name: Clone keanu-weblite repository (dev branch)
|
|
ansible.builtin.git:
|
|
repo: https://gitlab.com/keanuapp/keanuapp-weblite.git
|
|
dest: /tmp/keanu-weblite
|
|
version: dev
|
|
depth: 1
|
|
delegate_to: localhost
|
|
|
|
- name: Run npm install
|
|
ansible.builtin.command: npm install
|
|
args:
|
|
chdir: /tmp/keanu-weblite
|
|
delegate_to: localhost
|
|
changed_when: false
|
|
|
|
- name: Download keanu-weblite config file
|
|
ansible.builtin.template:
|
|
src: "templates/keanu-weblite-config.json.j2"
|
|
dest: /tmp/keanu-weblite/src/assets/config.json
|
|
mode: '0644'
|
|
delegate_to: localhost
|
|
|
|
- name: Run npm build with legacy OpenSSL option
|
|
ansible.builtin.shell: |
|
|
export NODE_OPTIONS=--openssl-legacy-provider
|
|
npm run build
|
|
args:
|
|
chdir: /tmp/keanu-weblite
|
|
delegate_to: localhost
|
|
changed_when: false
|
|
|
|
- name: Copy build output to /var/www/html/chat
|
|
ansible.builtin.copy:
|
|
src: /tmp/keanu-weblite/dist/
|
|
dest: /var/www/html/chat/
|
|
mode: '0755'
|
|
|
|
- name: Set permissions for /var/www/html/chat
|
|
ansible.builtin.file:
|
|
path: /var/www/html/chat
|
|
owner: www-data
|
|
group: www-data
|
|
mode: '0755'
|
|
recurse: true
|