diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ce28721..6b28c2f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,22 @@ # 2018-08-08 +## (BC Break) Renaming playbook variables + +The following playbook variables were renamed: + +- from `matrix_max_upload_size_mb` to `matrix_synapse_max_upload_size_mb` +- from `matrix_max_log_file_size_mb` to `matrix_synapse_max_log_file_size_mb` +- from `matrix_max_log_files_count` to `matrix_synapse_max_log_files_count` +- from `docker_matrix_image` to `matrix_docker_image_synapse` +- from `docker_nginx_image` to `matrix_docker_image_nginx` +- from `docker_riot_image` to `matrix_docker_image_riot` +- from `docker_goofys_image` to `matrix_docker_image_goofys` +- from `docker_coturn_image` to `matrix_docker_image_coturn` + +If you're overriding any of them in your `vars.yml` file, you'd need to change to the new names. + + ## Renaming Ansible playbook tag The command for executing the whole playbook has changed. diff --git a/roles/matrix-server/defaults/main.yml b/roles/matrix-server/defaults/main.yml index 170b1390..f1d3899f 100644 --- a/roles/matrix-server/defaults/main.yml +++ b/roles/matrix-server/defaults/main.yml @@ -46,9 +46,9 @@ matrix_synapse_macaroon_secret_key: "" matrix_synapse_registration_shared_secret: "{{ matrix_synapse_macaroon_secret_key }}" matrix_synapse_form_secret: "{{ matrix_synapse_macaroon_secret_key }}" -matrix_max_upload_size_mb: 10 -matrix_max_log_file_size_mb: 100 -matrix_max_log_files_count: 10 +matrix_synapse_max_upload_size_mb: 10 +matrix_synapse_max_log_file_size_mb: 100 +matrix_synapse_max_log_files_count: 10 matrix_postgres_data_path: "{{ matrix_base_data_path }}/postgres" matrix_nginx_proxy_data_path: "{{ matrix_base_data_path }}/nginx-proxy" @@ -59,16 +59,16 @@ matrix_coturn_config_path: "{{ matrix_coturn_base_path }}/turnserver.conf" matrix_scratchpad_dir: "{{ matrix_base_data_path }}/scratchpad" -docker_postgres_image_v9: "postgres:9.6.9-alpine" -docker_postgres_image_v10: "postgres:10.4-alpine" -docker_postgres_image_latest: "{{ docker_postgres_image_v10 }}" +matrix_docker_image_postgres_v9: "postgres:9.6.9-alpine" +matrix_docker_image_postgres_v10: "postgres:10.4-alpine" +matrix_docker_image_postgres_latest: "{{ matrix_docker_image_postgres_v10 }}" -docker_matrix_image: "matrixdotorg/synapse:v0.33.1" -docker_nginx_image: "nginx:1.15.2-alpine" -docker_riot_image: "avhost/docker-matrix-riot:v0.16.0" -docker_s3fs_image: "xueshanf/s3fs:latest" -docker_goofys_image: "cloudproto/goofys:latest" -docker_coturn_image: "instrumentisto/coturn:4.5.0.7" +matrix_docker_image_synapse: "matrixdotorg/synapse:v0.33.1" +matrix_docker_image_nginx: "nginx:1.15.2-alpine" +matrix_docker_image_riot: "avhost/docker-matrix-riot:v0.16.0" +matrix_docker_image_s3fs: "xueshanf/s3fs:latest" +matrix_docker_image_goofys: "cloudproto/goofys:latest" +matrix_docker_image_coturn: "instrumentisto/coturn:4.5.0.7" # The Docker network that all services would be put into matrix_docker_network: "matrix" diff --git a/roles/matrix-server/tasks/import_sqlite_db.yml b/roles/matrix-server/tasks/import_sqlite_db.yml index b56fb293..1757087c 100644 --- a/roles/matrix-server/tasks/import_sqlite_db.yml +++ b/roles/matrix-server/tasks/import_sqlite_db.yml @@ -52,7 +52,7 @@ - name: Importing SQLite database into Postgres docker_container: name: matrix-synapse-migrate - image: "{{ docker_matrix_image }}" + image: "{{ matrix_docker_image_synapse }}" detach: no cleanup: yes entrypoint: /usr/bin/python @@ -69,4 +69,4 @@ - name: Ensure scratchpad directory is deleted file: path: "{{ matrix_scratchpad_dir }}" - state: absent \ No newline at end of file + state: absent diff --git a/roles/matrix-server/tasks/setup_coturn.yml b/roles/matrix-server/tasks/setup_coturn.yml index 11b48d4a..8739d3a2 100644 --- a/roles/matrix-server/tasks/setup_coturn.yml +++ b/roles/matrix-server/tasks/setup_coturn.yml @@ -7,7 +7,7 @@ - name: Ensure Coturn image is pulled docker_image: - name: "{{ docker_coturn_image }}" + name: "{{ matrix_docker_image_coturn }}" - name: Ensure Coturn configuration path exists file: @@ -39,4 +39,4 @@ - '3478/tcp' # STUN - '3478/udp' # STUN - "{{ matrix_coturn_turn_udp_min_port }}-{{ matrix_coturn_turn_udp_max_port }}/udp" # TURN - when: ansible_os_family == 'RedHat' \ No newline at end of file + when: ansible_os_family == 'RedHat' diff --git a/roles/matrix-server/tasks/setup_goofys.yml b/roles/matrix-server/tasks/setup_goofys.yml index ab2a6365..bcca60f3 100644 --- a/roles/matrix-server/tasks/setup_goofys.yml +++ b/roles/matrix-server/tasks/setup_goofys.yml @@ -4,7 +4,7 @@ - name: Ensure Goofys Docker image is pulled docker_image: - name: "{{ docker_goofys_image }}" + name: "{{ matrix_docker_image_goofys }}" when: matrix_s3_media_store_enabled # This will throw a Permission Denied error if already mounted @@ -65,6 +65,6 @@ - name: Ensure Goofys Docker image doesn't exist docker_image: - name: "{{ docker_goofys_image }}" + name: "{{ matrix_docker_image_goofys }}" state: absent when: "not matrix_s3_media_store_enabled" diff --git a/roles/matrix-server/tasks/setup_nginx_proxy.yml b/roles/matrix-server/tasks/setup_nginx_proxy.yml index c8365c2b..dfcb96af 100644 --- a/roles/matrix-server/tasks/setup_nginx_proxy.yml +++ b/roles/matrix-server/tasks/setup_nginx_proxy.yml @@ -36,7 +36,7 @@ # - name: Ensure nginx Docker image is pulled docker_image: - name: "{{ docker_nginx_image }}" + name: "{{ matrix_docker_image_nginx }}" when: matrix_nginx_proxy_enabled - name: Allow access to nginx proxy ports in firewalld @@ -87,4 +87,4 @@ file: path: "/etc/cron.d/matrix-nginx-proxy-periodic-restarter" state: absent - when: "not matrix_nginx_proxy_enabled" \ No newline at end of file + when: "not matrix_nginx_proxy_enabled" diff --git a/roles/matrix-server/tasks/setup_postgres.yml b/roles/matrix-server/tasks/setup_postgres.yml index 92f125e0..8242fa4e 100644 --- a/roles/matrix-server/tasks/setup_postgres.yml +++ b/roles/matrix-server/tasks/setup_postgres.yml @@ -26,21 +26,21 @@ - name: Determine Postgres version to use (default to latest) set_fact: - docker_postgres_image_to_use: "{{ docker_postgres_image_latest }}" + matrix_docker_image_postgres_to_use: "{{ matrix_docker_image_postgres_latest }}" - name: Determine Postgres version to use (use 9.x, if detected) set_fact: - docker_postgres_image_to_use: "{{ docker_postgres_image_v9 }}" + matrix_docker_image_postgres_to_use: "{{ matrix_docker_image_postgres_v9 }}" when: "pg_version.startswith('9.')" - debug: - msg: "NOTE: Your setup is on an old Postgres version ({{ docker_postgres_image_to_use }}), while {{ docker_postgres_image_latest }} is supported. You can upgrade using --tags=upgrade-postgres" - when: "docker_postgres_image_to_use != docker_postgres_image_latest" + msg: "NOTE: Your setup is on an old Postgres version ({{ matrix_docker_image_postgres_to_use }}), while {{ matrix_docker_image_postgres_latest }} is supported. You can upgrade using --tags=upgrade-postgres" + when: "matrix_docker_image_postgres_to_use != matrix_docker_image_postgres_latest" # Even if we don't run the internal server, we still need this for running the CLI - name: Ensure postgres Docker image is pulled docker_image: - name: "{{ docker_postgres_image_to_use }}" + name: "{{ matrix_docker_image_postgres_to_use }}" - name: Ensure Postgres environment variables file created template: diff --git a/roles/matrix-server/tasks/setup_riot_web.yml b/roles/matrix-server/tasks/setup_riot_web.yml index d965217c..ab67a4c0 100644 --- a/roles/matrix-server/tasks/setup_riot_web.yml +++ b/roles/matrix-server/tasks/setup_riot_web.yml @@ -15,7 +15,7 @@ - name: Ensure riot-web Docker image is pulled docker_image: - name: "{{ docker_riot_image }}" + name: "{{ matrix_docker_image_riot }}" when: matrix_riot_web_enabled - name: Ensure Matrix riot-web configured @@ -64,6 +64,6 @@ - name: Ensure riot-web Docker image doesn't exist docker_image: - name: "{{ docker_riot_image }}" + name: "{{ matrix_docker_image_riot }}" state: absent when: "not matrix_riot_web_enabled" diff --git a/roles/matrix-server/tasks/setup_s3fs.yml b/roles/matrix-server/tasks/setup_s3fs.yml index 49f64990..f3120809 100644 --- a/roles/matrix-server/tasks/setup_s3fs.yml +++ b/roles/matrix-server/tasks/setup_s3fs.yml @@ -23,5 +23,5 @@ - name: Ensure S3fs Docker image doesn't exist docker_image: - name: "{{ docker_s3fs_image }}" + name: "{{ matrix_docker_image_s3fs }}" state: absent diff --git a/roles/matrix-server/tasks/setup_synapse.yml b/roles/matrix-server/tasks/setup_synapse.yml index d8aabf06..eb254e75 100644 --- a/roles/matrix-server/tasks/setup_synapse.yml +++ b/roles/matrix-server/tasks/setup_synapse.yml @@ -39,7 +39,7 @@ - name: Ensure Matrix Docker image is pulled docker_image: - name: "{{ docker_matrix_image }}" + name: "{{ matrix_docker_image_synapse }}" - name: Check if a Matrix Synapse configuration exists stat: @@ -51,7 +51,7 @@ - name: Generate initial Matrix config docker_container: name: matrix-config - image: "{{ docker_matrix_image }}" + image: "{{ matrix_docker_image_synapse }}" detach: no cleanup: yes command: generate diff --git a/roles/matrix-server/tasks/upgrade_postgres.yml b/roles/matrix-server/tasks/upgrade_postgres.yml index 8337d6eb..cdb39c70 100644 --- a/roles/matrix-server/tasks/upgrade_postgres.yml +++ b/roles/matrix-server/tasks/upgrade_postgres.yml @@ -52,16 +52,16 @@ - name: Determine Postgres version to use (default to latest) set_fact: - docker_postgres_image_to_use: "{{ docker_postgres_image_latest }}" + matrix_docker_image_postgres_to_use: "{{ matrix_docker_image_postgres_latest }}" - name: Determine Postgres version to use (use 9.x, if detected) set_fact: - docker_postgres_image_to_use: "{{ docker_postgres_image_v9 }}" + matrix_docker_image_postgres_to_use: "{{ matrix_docker_image_postgres_v9 }}" when: "pg_version.startswith('9.')" - name: Abort, if already at latest Postgres version fail: msg="You are already running the latest Postgres version supported. Nothing to do" - when: "docker_postgres_image_to_use == docker_postgres_image_latest" + when: "matrix_docker_image_postgres_to_use == matrix_docker_image_postgres_latest" - name: Ensure matrix-synapse is stopped service: name=matrix-synapse state=stopped @@ -81,7 +81,7 @@ --link matrix-postgres:postgres \ --env-file={{ matrix_environment_variables_data_path }}/env-postgres-pgsql-docker \ -v {{ postgres_dump_dir }}:/out \ - {{ docker_postgres_image_to_use }} pg_dump -h postgres {{ matrix_postgres_db_name }} -f /out/{{ postgres_dump_name }} + {{ matrix_docker_image_postgres_to_use }} pg_dump -h postgres {{ matrix_postgres_db_name }} -f /out/{{ postgres_dump_name }} - name: Ensure matrix-postgres is stopped service: name=matrix-postgres state=stopped @@ -109,7 +109,7 @@ --link matrix-postgres:postgres \ --env-file={{ matrix_environment_variables_data_path }}/env-postgres-pgsql-docker \ -v {{ postgres_dump_dir }}:/in:ro \ - {{ docker_postgres_image_latest }} psql -h postgres -f /in/{{ postgres_dump_name }} + {{ matrix_docker_image_postgres_latest }} psql -h postgres -f /in/{{ postgres_dump_name }} - name: Delete Postgres database dump file file: diff --git a/roles/matrix-server/templates/nginx-conf.d/matrix-synapse.conf.j2 b/roles/matrix-server/templates/nginx-conf.d/matrix-synapse.conf.j2 index 56c78657..25276fa4 100644 --- a/roles/matrix-server/templates/nginx-conf.d/matrix-synapse.conf.j2 +++ b/roles/matrix-server/templates/nginx-conf.d/matrix-synapse.conf.j2 @@ -53,7 +53,7 @@ server { proxy_set_header X-Forwarded-For $remote_addr; client_body_buffer_size 25M; - client_max_body_size {{ matrix_max_upload_size_mb }}M; + client_max_body_size {{ matrix_synapse_max_upload_size_mb }}M; proxy_max_temp_file_size 0; } } diff --git a/roles/matrix-server/templates/synapse/homeserver.yaml.j2 b/roles/matrix-server/templates/synapse/homeserver.yaml.j2 index 9b339516..3f908aae 100644 --- a/roles/matrix-server/templates/synapse/homeserver.yaml.j2 +++ b/roles/matrix-server/templates/synapse/homeserver.yaml.j2 @@ -257,7 +257,7 @@ media_store_path: "/matrix-storage/media-store" uploads_path: "/matrix-run/uploads" # The largest allowed upload size in bytes -max_upload_size: "{{ matrix_max_upload_size_mb }}M" +max_upload_size: "{{ matrix_synapse_max_upload_size_mb }}M" # Maximum number of pixels that will be thumbnailed max_image_pixels: "32M" diff --git a/roles/matrix-server/templates/synapse/synapse.log.config.j2 b/roles/matrix-server/templates/synapse/synapse.log.config.j2 index f424d4be..2b779653 100644 --- a/roles/matrix-server/templates/synapse/synapse.log.config.j2 +++ b/roles/matrix-server/templates/synapse/synapse.log.config.j2 @@ -15,8 +15,8 @@ handlers: class: logging.handlers.RotatingFileHandler formatter: precise filename: /matrix-run/homeserver.log - maxBytes: {{ matrix_max_log_file_size_mb * 1024 * 1024 }} - backupCount: {{ matrix_max_log_files_count }} + maxBytes: {{ matrix_synapse_max_log_file_size_mb * 1024 * 1024 }} + backupCount: {{ matrix_synapse_max_log_files_count }} filters: [context] console: class: logging.StreamHandler diff --git a/roles/matrix-server/templates/systemd/matrix-coturn.service.j2 b/roles/matrix-server/templates/systemd/matrix-coturn.service.j2 index df5d74f2..89cffa22 100644 --- a/roles/matrix-server/templates/systemd/matrix-coturn.service.j2 +++ b/roles/matrix-server/templates/systemd/matrix-coturn.service.j2 @@ -14,7 +14,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-coturn \ -p {{ matrix_coturn_turn_udp_min_port }}-{{ matrix_coturn_turn_udp_max_port }}:{{ matrix_coturn_turn_udp_min_port }}-{{ matrix_coturn_turn_udp_max_port }}/udp \ -v {{ matrix_synapse_config_dir_path }}:/matrix-config:ro \ -v {{ matrix_coturn_config_path }}:/turnserver.conf:ro \ - {{ docker_coturn_image }} \ + {{ matrix_docker_image_coturn }} \ -c /turnserver.conf ExecStop=-/usr/bin/docker kill matrix-coturn ExecStop=-/usr/bin/docker rm matrix-coturn diff --git a/roles/matrix-server/templates/systemd/matrix-goofys.service.j2 b/roles/matrix-server/templates/systemd/matrix-goofys.service.j2 index 9107ca9a..2273e3ed 100644 --- a/roles/matrix-server/templates/systemd/matrix-goofys.service.j2 +++ b/roles/matrix-server/templates/systemd/matrix-goofys.service.j2 @@ -18,7 +18,7 @@ ExecStart=/usr/bin/docker run --rm --name %n \ -v {{ matrix_synapse_media_store_path }}:/s3:shared \ --env-file={{ matrix_environment_variables_data_path }}/goofys \ --entrypoint /bin/sh \ - {{ docker_goofys_image }} \ + {{ matrix_docker_image_goofys }} \ -c 'goofys -f --storage-class=STANDARD_IA --region {{ matrix_s3_media_store_region }} --stat-cache-ttl 60m0s --type-cache-ttl 60m0s --dir-mode 0700 --file-mode 0700 {{ matrix_s3_media_store_bucket_name }} /s3' TimeoutStartSec=5min ExecStop=-/usr/bin/docker stop %n diff --git a/roles/matrix-server/templates/systemd/matrix-nginx-proxy.service.j2 b/roles/matrix-server/templates/systemd/matrix-nginx-proxy.service.j2 index c37b209f..ccf24942 100644 --- a/roles/matrix-server/templates/systemd/matrix-nginx-proxy.service.j2 +++ b/roles/matrix-server/templates/systemd/matrix-nginx-proxy.service.j2 @@ -17,7 +17,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-nginx-proxy \ -p 443:443 \ -v {{ matrix_nginx_proxy_confd_path }}:/etc/nginx/conf.d:ro \ -v {{ matrix_ssl_certs_path }}:{{ matrix_ssl_certs_path }}:ro \ - {{ docker_nginx_image }} + {{ matrix_docker_image_nginx }} ExecStop=-/usr/bin/docker kill matrix-nginx-proxy ExecStop=-/usr/bin/docker rm matrix-nginx-proxy ExecReload=/usr/bin/docker exec matrix-nginx-proxy /usr/sbin/nginx -s reload diff --git a/roles/matrix-server/templates/systemd/matrix-postgres.service.j2 b/roles/matrix-server/templates/systemd/matrix-postgres.service.j2 index 60edf39b..458fd22a 100644 --- a/roles/matrix-server/templates/systemd/matrix-postgres.service.j2 +++ b/roles/matrix-server/templates/systemd/matrix-postgres.service.j2 @@ -15,7 +15,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-postgres \ --env-file={{ matrix_environment_variables_data_path }}/env-postgres-server-docker \ -v {{ matrix_postgres_data_path }}:/var/lib/postgresql/data \ -v /etc/passwd:/etc/passwd:ro \ - {{ docker_postgres_image_to_use }} + {{ matrix_docker_image_postgres_to_use }} ExecStop=-/usr/bin/docker stop matrix-postgres ExecStop=-/usr/bin/docker rm matrix-postgres Restart=always diff --git a/roles/matrix-server/templates/systemd/matrix-riot-web.service.j2 b/roles/matrix-server/templates/systemd/matrix-riot-web.service.j2 index ee2035c6..347cdfed 100644 --- a/roles/matrix-server/templates/systemd/matrix-riot-web.service.j2 +++ b/roles/matrix-server/templates/systemd/matrix-riot-web.service.j2 @@ -15,7 +15,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-riot-web \ {% if not matrix_nginx_proxy_enabled %} -p 127.0.0.1:8765:8765 \ {% endif %} - {{ docker_riot_image }} + {{ matrix_docker_image_riot }} ExecStop=-/usr/bin/docker kill matrix-riot-web ExecStop=-/usr/bin/docker rm matrix-riot-web Restart=always diff --git a/roles/matrix-server/templates/systemd/matrix-synapse.service.j2 b/roles/matrix-server/templates/systemd/matrix-synapse.service.j2 index 7eb70e36..4b716547 100644 --- a/roles/matrix-server/templates/systemd/matrix-synapse.service.j2 +++ b/roles/matrix-server/templates/systemd/matrix-synapse.service.j2 @@ -32,7 +32,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-synapse \ -v {{ matrix_synapse_run_path }}:/matrix-run \ -v {{ matrix_synapse_storage_path }}:/matrix-storage:slave \ -e SYNAPSE_CONFIG_PATH=/data/homeserver.yaml \ - {{ docker_matrix_image }} + {{ matrix_docker_image_synapse }} ExecStop=-/usr/bin/docker kill matrix-synapse ExecStop=-/usr/bin/docker rm matrix-synapse Restart=always diff --git a/roles/matrix-server/templates/usr-local-bin/matrix-postgres-cli.j2 b/roles/matrix-server/templates/usr-local-bin/matrix-postgres-cli.j2 index d821c4bb..bcb5db8c 100644 --- a/roles/matrix-server/templates/usr-local-bin/matrix-postgres-cli.j2 +++ b/roles/matrix-server/templates/usr-local-bin/matrix-postgres-cli.j2 @@ -5,5 +5,5 @@ docker run \ --rm \ --env-file={{ matrix_environment_variables_data_path }}/env-postgres-pgsql-docker \ --network {{ matrix_docker_network }} \ - {{ docker_postgres_image_to_use }} \ - psql -h {{ matrix_postgres_connection_hostname }} \ No newline at end of file + {{ matrix_docker_image_postgres_to_use }} \ + psql -h {{ matrix_postgres_connection_hostname }}