From d5aabc85be569354dc99f967ba3c397e371880ac Mon Sep 17 00:00:00 2001 From: wjbeckett Date: Tue, 1 Oct 2024 10:41:30 +1000 Subject: [PATCH] removed redis images in favor of the inbuilt keyDB --- group_vars/matrix_servers | 2 -- .../matrix-element-call/defaults/main.yml | 7 ---- .../matrix-element-call/tasks/install.yml | 26 +-------------- .../matrix-element-call/tasks/uninstall.yml | 10 ------ .../tasks/validate_config.yml | 1 - .../templates/redis.conf.j2 | 5 --- .../templates/systemd/matrix-redis.service.j2 | 32 ------------------- 7 files changed, 1 insertion(+), 82 deletions(-) delete mode 100644 roles/custom/matrix-element-call/templates/redis.conf.j2 delete mode 100644 roles/custom/matrix-element-call/templates/systemd/matrix-redis.service.j2 diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index c97697011..6728825fa 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -439,8 +439,6 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': 'matrix-livekit-server.service', 'priority': 3000, 'groups': ['matrix', 'livekit-server']}] if matrix_livekit_server_enabled else []) + - ([{'name': 'matrix-redis.service', 'priority': 450, 'groups': ['matrix', 'redis']}] if matrix_element_call_enabled else []) - + ([{'name': 'matrix-registration.service', 'priority': 4000, 'groups': ['matrix', 'registration', 'matrix-registration']}] if matrix_registration_enabled else []) + ([{'name': 'matrix-sliding-sync.service', 'priority': 1500, 'groups': ['matrix', 'sliding-sync']}] if matrix_sliding_sync_enabled else []) diff --git a/roles/custom/matrix-element-call/defaults/main.yml b/roles/custom/matrix-element-call/defaults/main.yml index eb7652b1a..393863ad5 100644 --- a/roles/custom/matrix-element-call/defaults/main.yml +++ b/roles/custom/matrix-element-call/defaults/main.yml @@ -14,11 +14,9 @@ matrix_element_call_container_additional_networks: [] # No additional networks # Docker images matrix_element_call_image: "ghcr.io/element-hq/element-call:latest" -redis_image: "redis:6-alpine" # Ports matrix_element_call_port: "8093" -redis_port: "6379" # Well-known paths and domains (derived from matrix_domain) matrix_element_call_domain: "call.{{ matrix_domain }}" @@ -26,11 +24,6 @@ matrix_element_call_well_known_client_path: "{{ matrix_base_data_path }}/static- matrix_element_call_well_known_element_path: "{{ matrix_base_data_path }}/static-files/public/.well-known/element/element.json" matrix_element_call_base_url: "https://{{ matrix_element_call_domain }}" -# Redis Configuration for Element Call -redis_hostname: "localhost" -#redis_port: 6379 -redis_password: "" - # Traefik Configuration for Element Call matrix_element_call_container_labels_traefik_enabled: true matrix_element_call_container_labels_traefik_docker_network: "{{ matrix_element_call_container_network }}" diff --git a/roles/custom/matrix-element-call/tasks/install.yml b/roles/custom/matrix-element-call/tasks/install.yml index cd0612fce..266a9407b 100644 --- a/roles/custom/matrix-element-call/tasks/install.yml +++ b/roles/custom/matrix-element-call/tasks/install.yml @@ -22,14 +22,6 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" -- name: Ensure Redis redis.conf is in place - ansible.builtin.template: - src: "{{ role_path }}/templates/redis.conf.j2" - dest: "{{ matrix_element_call_base_path }}/backend/redis.conf" - mode: 0640 - owner: "{{ matrix_user_username }}" - group: "{{ matrix_user_groupname }}" - - name: Ensure matrix-element-call Docker labels file is in place ansible.builtin.template: src: "{{ role_path }}/templates/element-call-labels.j2" @@ -49,29 +41,13 @@ delay: "{{ devture_playbook_help_container_retries_delay }}" until: element_call_image_result is not failed -- name: Ensure redis Docker image is pulled - community.docker.docker_image: - name: "{{ redis_image }}" - source: pull - register: redis_image_result - retries: 3 - delay: 10 - until: redis_image_result is not failed - -# Systemd Services for Element Call, JWT Service, LiveKit, and Redis - +# Systemd Services for Element Call - name: Ensure matrix-element-call systemd service is installed ansible.builtin.template: src: "{{ role_path }}/templates/systemd/matrix-element-call.service.j2" dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-element-call.service" mode: 0644 -- name: Ensure redis systemd service is installed - ansible.builtin.template: - src: "{{ role_path }}/templates/systemd/matrix-redis.service.j2" - dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-redis.service" - mode: 0644 - # Update homeserver.yaml for Element Call - name: Add listeners section for Element Call to homeserver.yaml ansible.builtin.blockinfile: diff --git a/roles/custom/matrix-element-call/tasks/uninstall.yml b/roles/custom/matrix-element-call/tasks/uninstall.yml index d137136c2..184f88ac2 100644 --- a/roles/custom/matrix-element-call/tasks/uninstall.yml +++ b/roles/custom/matrix-element-call/tasks/uninstall.yml @@ -6,21 +6,11 @@ name: "matrix-element-call" state: absent -- name: Stop and remove redis container - community.docker.docker_container: - name: "matrix-redis" - state: absent - - name: Remove matrix-element-call systemd service ansible.builtin.file: path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-element-call.service" state: absent -- name: Remove redis systemd service - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-redis.service" - state: absent - - name: Remove matrix-element-call configuration files ansible.builtin.file: path: "{{ matrix_element_call_base_path }}" diff --git a/roles/custom/matrix-element-call/tasks/validate_config.yml b/roles/custom/matrix-element-call/tasks/validate_config.yml index 5c00dcc92..084e510d6 100644 --- a/roles/custom/matrix-element-call/tasks/validate_config.yml +++ b/roles/custom/matrix-element-call/tasks/validate_config.yml @@ -10,4 +10,3 @@ - {'name': 'matrix_element_call_base_path', when: true} - {'name': 'matrix_element_call_container_network', when: true} - {'name': 'matrix_element_call_image', when: true} - - {'name': 'redis_image', when: true} diff --git a/roles/custom/matrix-element-call/templates/redis.conf.j2 b/roles/custom/matrix-element-call/templates/redis.conf.j2 deleted file mode 100644 index 32a39f7be..000000000 --- a/roles/custom/matrix-element-call/templates/redis.conf.j2 +++ /dev/null @@ -1,5 +0,0 @@ -bind 0.0.0.0 -protected-mode yes -port 6379 -timeout 0 -tcp-keepalive 300 diff --git a/roles/custom/matrix-element-call/templates/systemd/matrix-redis.service.j2 b/roles/custom/matrix-element-call/templates/systemd/matrix-redis.service.j2 deleted file mode 100644 index f65b0c766..000000000 --- a/roles/custom/matrix-element-call/templates/systemd/matrix-redis.service.j2 +++ /dev/null @@ -1,32 +0,0 @@ -[Unit] -Description=Matrix Redis Service -After=docker.service -Requires=docker.service - -[Service] -Type=simple -Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}" -ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-redis 2>/dev/null || true' -ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-redis 2>/dev/null || true' - -ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ - --rm \ - --name=matrix-redis \ - --log-driver=none \ - --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ - --cap-drop=ALL \ - --network={{ matrix_element_call_container_network }} \ - --mount type=bind,src={{ matrix_element_call_base_path }}/redis.conf,dst=/etc/redis.conf,ro \ - {{ redis_image }} \ - redis-server /etc/redis.conf - -ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-redis - -ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-redis 2>/dev/null || true' -ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-redis 2>/dev/null || true' -Restart=always -RestartSec=30 -SyslogIdentifier=matrix-redis - -[Install] -WantedBy=multi-user.target