minor fixes, add a redlight install section for rapid testing

This commit is contained in:
PC-Admin
2023-08-11 01:51:55 +08:00
parent bb10c3a4b9
commit a707d8a746
14 changed files with 124 additions and 17 deletions

View File

@@ -1,4 +1,4 @@
---
- name: Install Certbot
apt:
name: certbot

View File

@@ -1,4 +1,4 @@
---
- name: Install NGINX
apt:
name: nginx
@@ -16,3 +16,15 @@
src: "/etc/nginx/sites-available/{{ server_name }}"
dest: "/etc/nginx/sites-enabled/{{ server_name }}"
state: link
- name: Remove default Nginx Config
file:
path: /etc/nginx/sites-enabled/default
state: absent
notify: Restart Nginx
- name: Remove 'matrix' Nginx Config
file:
path: /etc/nginx/sites-enabled/matrix
state: absent
notify: Restart Nginx

View File

@@ -27,11 +27,11 @@
state: absent
notify: Restart Nginx
- name: Set Synapse Cache Factor
lineinfile:
path: /etc/default/matrix-synapse
regexp: '^SYNAPSE_CACHE_FACTOR='
line: 'SYNAPSE_CACHE_FACTOR=2.0'
state: present
create: yes
notify: Restart Synapse
# - name: Set Synapse Cache Factor
# lineinfile:
# path: /etc/default/matrix-synapse
# regexp: '^SYNAPSE_CACHE_FACTOR='
# line: 'SYNAPSE_CACHE_FACTOR=2.0'
# state: present
# create: yes
# notify: Restart Synapse

View File

@@ -0,0 +1,4 @@
- name: Create Testing User
shell: |
sudo -u matrix-synapse python3 /opt/venvs/matrix-synapse/lib/python3.11/site-packages/synapse/_scripts/register_new_matrix_user.py -c /etc/matrix-synapse/homeserver.yaml http://localhost:8008 --user {{ testing_user.username }} --password {{ testing_user.password }}

View File

@@ -3,7 +3,7 @@
become: yes
template:
src: "{{ role_path }}/templates/nginx-element.conf.j2"
dest: "/etc/nginx/sites-available/element.{{ server_name}}.conf"
dest: "/etc/nginx/sites-available/element"
owner: root
group: root
mode: '0644'
@@ -12,8 +12,8 @@
- name: Create symbolic link for NGINX config
become: yes
file:
src: /etc/nginx/sites-available/element.{{ server_name}}.conf
dest: /etc/nginx/sites-enabled/element.{{ server_name}}.conf
src: /etc/nginx/sites-available/element
dest: /etc/nginx/sites-enabled/element
state: link
force: yes

View File

@@ -16,4 +16,8 @@
# Install Element Web
- import_tasks: "{{ role_path }}/tasks/element_setup.yml"
tags: install-element
tags: install-element
# Create Admin User
- import_tasks: "{{ role_path }}/tasks/create_admin_user.yml"
tags: create-admin-user