Rename playbook variables so they are consistently prefixed
Pretty much all variables live in their own `matrix_<whatever>` prefix now and are grouped closer together in the default variables file (`roles/matrix-server/defaults/main.yml`).
This commit is contained in:
		
							
								
								
									
										21
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								CHANGELOG.md
									
									
									
									
									
								
							@@ -1,3 +1,24 @@
 | 
			
		||||
# 2018-11-01
 | 
			
		||||
 | 
			
		||||
## (BC Break) Renaming playbook variables
 | 
			
		||||
 | 
			
		||||
Due to the large amount of features added to this playbook lately, to keep things manageable we've had to reorganize its configuration variables a bit.
 | 
			
		||||
 | 
			
		||||
The following playbook variables were renamed:
 | 
			
		||||
 | 
			
		||||
- from `matrix_docker_image_mxisd` to `matrix_mxisd_docker_image`
 | 
			
		||||
- from `matrix_docker_image_mautrix_telegram` to `matrix_mautrix_telegram_docker_image`
 | 
			
		||||
- from `matrix_docker_image_mautrix_whatsapp` to `matrix_mautrix_whatsapp_docker_image`
 | 
			
		||||
- from `matrix_docker_image_mailer` to `matrix_mailer_docker_image`
 | 
			
		||||
- from `matrix_docker_image_coturn` to `matrix_coturn_docker_image`
 | 
			
		||||
- from `matrix_docker_image_goofys` to `matrix_s3_goofys_docker_image`
 | 
			
		||||
- from `matrix_docker_image_riot` to `matrix_riot_web_docker_image`
 | 
			
		||||
- from `matrix_docker_image_nginx` to `matrix_nginx_proxy_docker_image`
 | 
			
		||||
- from `matrix_docker_image_synapse` to `matrix_synapse_docker_image`
 | 
			
		||||
- from `matrix_docker_image_postgres_v9` to `matrix_postgres_docker_image_v9`
 | 
			
		||||
- from `matrix_docker_image_postgres_v10` to `matrix_postgres_docker_image_v10`
 | 
			
		||||
- from `matrix_docker_image_postgres_latest` to `matrix_postgres_docker_image_latest`
 | 
			
		||||
 | 
			
		||||
# 2018-10-26
 | 
			
		||||
 | 
			
		||||
## Mautrix Whatsapp bridging support
 | 
			
		||||
 
 | 
			
		||||
@@ -11,21 +11,24 @@ hostname_matrix: "matrix.{{ hostname_identity }}"
 | 
			
		||||
# This and the Matrix hostname (see above) are expected to be on the same server.
 | 
			
		||||
hostname_riot: "riot.{{ hostname_identity }}"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
matrix_user_username: "matrix"
 | 
			
		||||
matrix_user_uid: 991
 | 
			
		||||
matrix_user_gid: 991
 | 
			
		||||
 | 
			
		||||
# The defaults below cause a postgres server to be configured (running within a container).
 | 
			
		||||
# Using an external server is possible by tweaking all of the parameters below.
 | 
			
		||||
matrix_postgres_use_external: false
 | 
			
		||||
matrix_postgres_connection_hostname: "matrix-postgres"
 | 
			
		||||
matrix_postgres_connection_username: "synapse"
 | 
			
		||||
matrix_postgres_connection_password: "synapse-password"
 | 
			
		||||
matrix_postgres_db_name: "homeserver"
 | 
			
		||||
 | 
			
		||||
matrix_base_data_path: "/matrix"
 | 
			
		||||
 | 
			
		||||
matrix_environment_variables_data_path: "{{ matrix_base_data_path }}/environment-variables"
 | 
			
		||||
matrix_scratchpad_dir: "{{ matrix_base_data_path }}/scratchpad"
 | 
			
		||||
matrix_static_files_base_path: "{{ matrix_base_data_path }}/static-files"
 | 
			
		||||
 | 
			
		||||
matrix_homeserver_url: "https://{{ hostname_matrix }}"
 | 
			
		||||
matrix_identity_server_url: "https://{{ matrix_synapse_trusted_third_party_id_servers[0] }}"
 | 
			
		||||
 | 
			
		||||
# The Docker network that all services would be put into
 | 
			
		||||
matrix_docker_network: "matrix"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
matrix_synapse_docker_image: "matrixdotorg/synapse:v0.33.7"
 | 
			
		||||
 | 
			
		||||
matrix_synapse_base_path: "{{ matrix_base_data_path }}/synapse"
 | 
			
		||||
matrix_synapse_config_dir_path: "{{ matrix_synapse_base_path }}/config"
 | 
			
		||||
@@ -114,6 +117,7 @@ matrix_synapse_app_service_config_files: []
 | 
			
		||||
# any password providers have been enabled or not.
 | 
			
		||||
matrix_synapse_password_providers_enabled: false
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Enable this to activate the REST auth password provider module.
 | 
			
		||||
# See: https://github.com/kamax-io/matrix-synapse-rest-auth
 | 
			
		||||
matrix_synapse_ext_password_provider_rest_auth_enabled: false
 | 
			
		||||
@@ -129,33 +133,26 @@ matrix_synapse_ext_password_provider_shared_secret_auth_enabled: false
 | 
			
		||||
matrix_synapse_ext_password_provider_shared_secret_auth_download_url: "https://raw.githubusercontent.com/devture/matrix-synapse-shared-secret-auth/1.0/shared_secret_authenticator.py"
 | 
			
		||||
matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret: ""
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# The defaults below cause a postgres server to be configured (running within a container).
 | 
			
		||||
# Using an external server is possible by tweaking all of the parameters below.
 | 
			
		||||
matrix_postgres_use_external: false
 | 
			
		||||
matrix_postgres_connection_hostname: "matrix-postgres"
 | 
			
		||||
matrix_postgres_connection_username: "synapse"
 | 
			
		||||
matrix_postgres_connection_password: "synapse-password"
 | 
			
		||||
matrix_postgres_db_name: "homeserver"
 | 
			
		||||
 | 
			
		||||
matrix_postgres_data_path: "{{ matrix_base_data_path }}/postgres"
 | 
			
		||||
matrix_nginx_proxy_data_path: "{{ matrix_base_data_path }}/nginx-proxy"
 | 
			
		||||
matrix_nginx_proxy_confd_path: "{{ matrix_nginx_proxy_data_path }}/conf.d"
 | 
			
		||||
matrix_riot_web_data_path: "{{ matrix_base_data_path }}/riot-web"
 | 
			
		||||
 | 
			
		||||
matrix_postgres_docker_image_v9: "postgres:9.6.10-alpine"
 | 
			
		||||
matrix_postgres_docker_image_v10: "postgres:10.5-alpine"
 | 
			
		||||
matrix_postgres_docker_image_latest: "{{ matrix_postgres_docker_image_v10 }}"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
matrix_coturn_docker_image: "instrumentisto/coturn:4.5.0.8"
 | 
			
		||||
 | 
			
		||||
matrix_coturn_base_path: "{{ matrix_base_data_path }}/coturn"
 | 
			
		||||
matrix_coturn_config_path: "{{ matrix_coturn_base_path }}/turnserver.conf"
 | 
			
		||||
matrix_scratchpad_dir: "{{ matrix_base_data_path }}/scratchpad"
 | 
			
		||||
matrix_mautrix_telegram_base_path: "{{ matrix_base_data_path }}/mautrix-telegram"
 | 
			
		||||
matrix_mautrix_whatsapp_base_path: "{{ matrix_base_data_path }}/mautrix-whatsapp"
 | 
			
		||||
matrix_static_files_base_path: "{{ matrix_base_data_path }}/static-files"
 | 
			
		||||
 | 
			
		||||
matrix_docker_image_postgres_v9: "postgres:9.6.10-alpine"
 | 
			
		||||
matrix_docker_image_postgres_v10: "postgres:10.5-alpine"
 | 
			
		||||
matrix_docker_image_postgres_latest: "{{ matrix_docker_image_postgres_v10 }}"
 | 
			
		||||
 | 
			
		||||
matrix_docker_image_synapse: "matrixdotorg/synapse:v0.33.7"
 | 
			
		||||
matrix_docker_image_nginx: "nginx:1.15.5-alpine"
 | 
			
		||||
matrix_docker_image_riot: "avhost/docker-matrix-riot:v0.17.3"
 | 
			
		||||
matrix_docker_image_goofys: "cloudproto/goofys:latest"
 | 
			
		||||
matrix_docker_image_coturn: "instrumentisto/coturn:4.5.0.8"
 | 
			
		||||
matrix_docker_image_mailer: "panubo/postfix:latest"
 | 
			
		||||
matrix_docker_image_mxisd: "kamax/mxisd:1.1.1"
 | 
			
		||||
matrix_docker_image_mautrix_telegram: "tulir/mautrix-telegram:v0.3.0"
 | 
			
		||||
matrix_docker_image_mautrix_whatsapp: "tulir/mautrix-whatsapp:latest"
 | 
			
		||||
 | 
			
		||||
# The Docker network that all services would be put into
 | 
			
		||||
matrix_docker_network: "matrix"
 | 
			
		||||
 | 
			
		||||
# A shared secret (between Synapse and Coturn) used for authentication.
 | 
			
		||||
# You can put any string here, but generating a strong one is preferred (e.g. `pwgen -s 64 1`).
 | 
			
		||||
@@ -169,6 +166,7 @@ matrix_coturn_turn_external_ip_address: "{{ ansible_host }}"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
matrix_s3_media_store_enabled: false
 | 
			
		||||
matrix_s3_goofys_docker_image: "cloudproto/goofys:latest"
 | 
			
		||||
matrix_s3_media_store_bucket_name: "your-bucket-name"
 | 
			
		||||
matrix_s3_media_store_aws_access_key: "your-aws-access-key"
 | 
			
		||||
matrix_s3_media_store_aws_secret_key: "your-aws-secret-key"
 | 
			
		||||
@@ -180,6 +178,8 @@ matrix_s3_media_store_region: "eu-central-1"
 | 
			
		||||
# Other services (like mxisd), however, also use that mailer to send emails through it.
 | 
			
		||||
matrix_mailer_enabled: true
 | 
			
		||||
 | 
			
		||||
matrix_mailer_docker_image: "panubo/postfix:latest"
 | 
			
		||||
 | 
			
		||||
matrix_mailer_sender_address: "matrix@{{ hostname_identity }}"
 | 
			
		||||
matrix_mailer_relay_use: false
 | 
			
		||||
matrix_mailer_relay_host_name: "mail.example.com"
 | 
			
		||||
@@ -193,7 +193,7 @@ matrix_mailer_relay_auth_password: ""
 | 
			
		||||
# If you wish to use the public identity servers (matrix.org, vector.im, riot.im) instead of your own,
 | 
			
		||||
# you may wish to disable this.
 | 
			
		||||
matrix_mxisd_enabled: true
 | 
			
		||||
 | 
			
		||||
matrix_mxisd_docker_image: "kamax/mxisd:1.1.1"
 | 
			
		||||
matrix_mxisd_base_path: "{{ matrix_base_data_path }}/mxisd"
 | 
			
		||||
matrix_mxisd_config_path: "{{ matrix_mxisd_base_path }}/config"
 | 
			
		||||
matrix_mxisd_data_path: "{{ matrix_mxisd_base_path }}/data"
 | 
			
		||||
@@ -236,17 +236,26 @@ matrix_corporal_policy_provider_config: ""
 | 
			
		||||
 | 
			
		||||
matrix_corporal_debug: false
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# By default, this playbook installs the Riot.IM web UI on the `hostname_riot` domain.
 | 
			
		||||
# If you wish to connect to your Matrix server by other means,
 | 
			
		||||
# you may wish to disable this.
 | 
			
		||||
matrix_riot_web_enabled: true
 | 
			
		||||
 | 
			
		||||
matrix_homeserver_url: "https://{{ hostname_matrix }}"
 | 
			
		||||
matrix_identity_server_url: "https://{{ matrix_synapse_trusted_third_party_id_servers[0] }}"
 | 
			
		||||
matrix_riot_web_docker_image: "avhost/docker-matrix-riot:v0.17.3"
 | 
			
		||||
 | 
			
		||||
matrix_riot_web_data_path: "{{ matrix_base_data_path }}/riot-web"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Matrix mautrix is a Matrix <-> Telegram bridge
 | 
			
		||||
# Enable telegram bridge
 | 
			
		||||
matrix_mautrix_telegram_enabled: false
 | 
			
		||||
 | 
			
		||||
matrix_mautrix_telegram_docker_image: "tulir/mautrix-telegram:v0.3.0"
 | 
			
		||||
 | 
			
		||||
matrix_mautrix_telegram_base_path: "{{ matrix_base_data_path }}/mautrix-telegram"
 | 
			
		||||
 | 
			
		||||
# Get your own API keys at https://my.telegram.org/apps
 | 
			
		||||
matrix_mautrix_telegram_api_id: YOUR_TELEGRAM_APP_ID
 | 
			
		||||
matrix_mautrix_telegram_api_hash: YOUR_TELEGRAM_API_HASH
 | 
			
		||||
@@ -254,16 +263,27 @@ matrix_mautrix_telegram_api_hash: YOUR_TELEGRAM_API_HASH
 | 
			
		||||
# Use an uuid so it's not easily discoverable
 | 
			
		||||
matrix_mautrix_telegram_public_endpoint: "/{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'telegram') | to_uuid }}"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Matrix mautrix is a Matrix <-> Whatsapp bridge
 | 
			
		||||
# Enable whatsapp bridge
 | 
			
		||||
matrix_mautrix_whatsapp_enabled: false
 | 
			
		||||
 | 
			
		||||
matrix_mautrix_whatsapp_docker_image: "tulir/mautrix-whatsapp:latest"
 | 
			
		||||
 | 
			
		||||
matrix_mautrix_whatsapp_base_path: "{{ matrix_base_data_path }}/mautrix-whatsapp"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# By default, this playbook sets up its own nginx proxy server on port 80/443.
 | 
			
		||||
# This is fine if you're dedicating the whole server to Matrix.
 | 
			
		||||
# But in case that's not the case, you may wish to prevent that
 | 
			
		||||
# and take care of proxying by yourself.
 | 
			
		||||
matrix_nginx_proxy_enabled: true
 | 
			
		||||
 | 
			
		||||
matrix_nginx_proxy_docker_image: "nginx:1.15.5-alpine"
 | 
			
		||||
 | 
			
		||||
matrix_nginx_proxy_data_path: "{{ matrix_base_data_path }}/nginx-proxy"
 | 
			
		||||
matrix_nginx_proxy_confd_path: "{{ matrix_nginx_proxy_data_path }}/conf.d"
 | 
			
		||||
 | 
			
		||||
# The addresses where the Matrix Client API is.
 | 
			
		||||
# Certain extensions (like matrix-corporal) may override this in order to capture all traffic.
 | 
			
		||||
matrix_nginx_proxy_matrix_client_api_addr_with_proxy_container: "matrix-synapse:8008"
 | 
			
		||||
 
 | 
			
		||||
@@ -52,7 +52,7 @@
 | 
			
		||||
- name: Importing SQLite database into Postgres
 | 
			
		||||
  docker_container:
 | 
			
		||||
    name: matrix-synapse-migrate
 | 
			
		||||
    image: "{{ matrix_docker_image_synapse }}"
 | 
			
		||||
    image: "{{ matrix_synapse_docker_image }}"
 | 
			
		||||
    detach: no
 | 
			
		||||
    cleanup: yes
 | 
			
		||||
    entrypoint: /usr/bin/python
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@
 | 
			
		||||
 | 
			
		||||
- name: Ensure Coturn image is pulled
 | 
			
		||||
  docker_image:
 | 
			
		||||
    name: "{{ matrix_docker_image_coturn }}"
 | 
			
		||||
    name: "{{ matrix_coturn_docker_image }}"
 | 
			
		||||
 | 
			
		||||
- name: Ensure Coturn configuration path exists
 | 
			
		||||
  file:
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
 | 
			
		||||
- name: Ensure Goofys Docker image is pulled
 | 
			
		||||
  docker_image:
 | 
			
		||||
    name: "{{ matrix_docker_image_goofys }}"
 | 
			
		||||
    name: "{{ matrix_s3_goofys_docker_image }}"
 | 
			
		||||
  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: "{{ matrix_docker_image_goofys }}"
 | 
			
		||||
    name: "{{ matrix_s3_goofys_docker_image }}"
 | 
			
		||||
    state: absent
 | 
			
		||||
  when: "not matrix_s3_media_store_enabled"
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@
 | 
			
		||||
 | 
			
		||||
- name: Ensure mailer image is pulled
 | 
			
		||||
  docker_image:
 | 
			
		||||
    name: "{{ matrix_docker_image_mailer }}"
 | 
			
		||||
    name: "{{ matrix_mailer_docker_image }}"
 | 
			
		||||
  when: matrix_mailer_enabled
 | 
			
		||||
 | 
			
		||||
- name: Ensure matrix-mailer.service installed
 | 
			
		||||
@@ -51,6 +51,6 @@
 | 
			
		||||
 | 
			
		||||
- name: Ensure mailer Docker image doesn't exist
 | 
			
		||||
  docker_image:
 | 
			
		||||
    name: "{{ matrix_docker_image_mailer }}"
 | 
			
		||||
    name: "{{ matrix_mailer_docker_image }}"
 | 
			
		||||
    state: absent
 | 
			
		||||
  when: "not matrix_mailer_enabled"
 | 
			
		||||
@@ -23,7 +23,7 @@
 | 
			
		||||
 | 
			
		||||
- name: Ensure mxisd image is pulled
 | 
			
		||||
  docker_image:
 | 
			
		||||
    name: "{{ matrix_docker_image_mxisd }}"
 | 
			
		||||
    name: "{{ matrix_mxisd_docker_image }}"
 | 
			
		||||
  when: matrix_mxisd_enabled
 | 
			
		||||
 | 
			
		||||
- name: Ensure mxisd config installed
 | 
			
		||||
@@ -69,6 +69,6 @@
 | 
			
		||||
 | 
			
		||||
- name: Ensure mxisd Docker image doesn't exist
 | 
			
		||||
  docker_image:
 | 
			
		||||
    name: "{{ matrix_docker_image_mxisd }}"
 | 
			
		||||
    name: "{{ matrix_mxisd_docker_image }}"
 | 
			
		||||
    state: absent
 | 
			
		||||
  when: "not matrix_mxisd_enabled"
 | 
			
		||||
@@ -36,7 +36,7 @@
 | 
			
		||||
#
 | 
			
		||||
- name: Ensure nginx Docker image is pulled
 | 
			
		||||
  docker_image:
 | 
			
		||||
    name: "{{ matrix_docker_image_nginx }}"
 | 
			
		||||
    name: "{{ matrix_nginx_proxy_docker_image }}"
 | 
			
		||||
  when: matrix_nginx_proxy_enabled
 | 
			
		||||
 | 
			
		||||
- name: Allow access to nginx proxy ports in firewalld
 | 
			
		||||
 
 | 
			
		||||
@@ -26,21 +26,21 @@
 | 
			
		||||
 | 
			
		||||
- name: Determine Postgres version to use (default to latest)
 | 
			
		||||
  set_fact:
 | 
			
		||||
    matrix_docker_image_postgres_to_use: "{{ matrix_docker_image_postgres_latest }}"
 | 
			
		||||
    matrix_postgres_docker_image_to_use: "{{ matrix_postgres_docker_image_latest }}"
 | 
			
		||||
 | 
			
		||||
- name: Determine Postgres version to use (use 9.x, if detected)
 | 
			
		||||
  set_fact:
 | 
			
		||||
    matrix_docker_image_postgres_to_use: "{{ matrix_docker_image_postgres_v9 }}"
 | 
			
		||||
    matrix_postgres_docker_image_to_use: "{{ matrix_postgres_docker_image_v9 }}"
 | 
			
		||||
  when: "pg_version.startswith('9.')"
 | 
			
		||||
 | 
			
		||||
- debug:
 | 
			
		||||
    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"
 | 
			
		||||
    msg: "NOTE: Your setup is on an old Postgres version ({{ matrix_postgres_docker_image_to_use }}), while {{ matrix_postgres_docker_image_latest }} is supported. You can upgrade using --tags=upgrade-postgres"
 | 
			
		||||
  when: "matrix_postgres_docker_image_to_use != matrix_postgres_docker_image_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: "{{ matrix_docker_image_postgres_to_use }}"
 | 
			
		||||
    name: "{{ matrix_postgres_docker_image_to_use }}"
 | 
			
		||||
 | 
			
		||||
- name: Ensure Postgres environment variables file created
 | 
			
		||||
  template:
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
 | 
			
		||||
- name: Ensure riot-web Docker image is pulled
 | 
			
		||||
  docker_image:
 | 
			
		||||
    name: "{{ matrix_docker_image_riot }}"
 | 
			
		||||
    name: "{{ matrix_riot_web_docker_image }}"
 | 
			
		||||
  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: "{{ matrix_docker_image_riot }}"
 | 
			
		||||
    name: "{{ matrix_riot_web_docker_image }}"
 | 
			
		||||
    state: absent
 | 
			
		||||
  when: "not matrix_riot_web_enabled"
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
- name: Ensure Mautrix Telegram image is pulled
 | 
			
		||||
  docker_image:
 | 
			
		||||
    name: "{{ matrix_docker_image_mautrix_telegram }}"
 | 
			
		||||
    name: "{{ matrix_mautrix_telegram_docker_image }}"
 | 
			
		||||
  when: "matrix_mautrix_telegram_enabled"
 | 
			
		||||
 | 
			
		||||
- name: Ensure Mautrix Telegram configuration path exists
 | 
			
		||||
@@ -37,7 +37,7 @@
 | 
			
		||||
  register: mautrix_telegram_registration_file
 | 
			
		||||
 | 
			
		||||
- name: Generate matrix-mautrix-telegram registration.yaml if it doesn't exist
 | 
			
		||||
  shell: /usr/bin/docker run --rm --name matrix-mautrix-telegram-gen -v {{ matrix_mautrix_telegram_base_path }}:/data:z {{ matrix_docker_image_mautrix_telegram }} python3 -m mautrix_telegram -g -c /data/config.yaml -r /data/registration.yaml
 | 
			
		||||
  shell: /usr/bin/docker run --rm --name matrix-mautrix-telegram-gen -v {{ matrix_mautrix_telegram_base_path }}:/data:z {{ matrix_mautrix_telegram_docker_image }} python3 -m mautrix_telegram -g -c /data/config.yaml -r /data/registration.yaml
 | 
			
		||||
  when: "matrix_mautrix_telegram_enabled and mautrix_telegram_registration_file.stat.exists == False"
 | 
			
		||||
 | 
			
		||||
- set_fact:
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
- name: Ensure Mautrix Whatsapp image is pulled
 | 
			
		||||
  docker_image:
 | 
			
		||||
    name: "{{ matrix_docker_image_mautrix_whatsapp }}"
 | 
			
		||||
    name: "{{ matrix_mautrix_whatsapp_docker_image }}"
 | 
			
		||||
  when: "matrix_mautrix_whatsapp_enabled"
 | 
			
		||||
 | 
			
		||||
- name: Ensure Mautrix Whatsapp configuration path exists
 | 
			
		||||
@@ -37,7 +37,7 @@
 | 
			
		||||
  register: mautrix_whatsapp_registration_file
 | 
			
		||||
 | 
			
		||||
- name: Generate matrix-mautrix-whatsapp registration.yaml if it doesn't exist
 | 
			
		||||
  shell: /usr/bin/docker run --rm --name matrix-mautrix-whatsapp-gen -v {{ matrix_mautrix_whatsapp_base_path }}:/data:z {{ matrix_docker_image_mautrix_whatsapp }} /usr/bin/mautrix-whatsapp -g -c /data/config.yaml -r /data/registration.yaml
 | 
			
		||||
  shell: /usr/bin/docker run --rm --name matrix-mautrix-whatsapp-gen -v {{ matrix_mautrix_whatsapp_base_path }}:/data:z {{ matrix_mautrix_whatsapp_docker_image }} /usr/bin/mautrix-whatsapp -g -c /data/config.yaml -r /data/registration.yaml
 | 
			
		||||
  when: "matrix_mautrix_whatsapp_enabled and mautrix_whatsapp_registration_file.stat.exists == False"
 | 
			
		||||
 | 
			
		||||
- set_fact:
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@
 | 
			
		||||
 | 
			
		||||
- name: Ensure Matrix Docker image is pulled
 | 
			
		||||
  docker_image:
 | 
			
		||||
    name: "{{ matrix_docker_image_synapse }}"
 | 
			
		||||
    name: "{{ matrix_synapse_docker_image }}"
 | 
			
		||||
 | 
			
		||||
- name: Check if a Matrix Synapse configuration exists
 | 
			
		||||
  stat:
 | 
			
		||||
@@ -36,7 +36,7 @@
 | 
			
		||||
- name: Generate initial Matrix config
 | 
			
		||||
  docker_container:
 | 
			
		||||
    name: matrix-config
 | 
			
		||||
    image: "{{ matrix_docker_image_synapse }}"
 | 
			
		||||
    image: "{{ matrix_synapse_docker_image }}"
 | 
			
		||||
    detach: no
 | 
			
		||||
    cleanup: yes
 | 
			
		||||
    command: generate
 | 
			
		||||
 
 | 
			
		||||
@@ -52,16 +52,16 @@
 | 
			
		||||
 | 
			
		||||
- name: Determine Postgres version to use (default to latest)
 | 
			
		||||
  set_fact:
 | 
			
		||||
    matrix_docker_image_postgres_to_use: "{{ matrix_docker_image_postgres_latest }}"
 | 
			
		||||
    matrix_postgres_docker_image_to_use: "{{ matrix_postgres_docker_image_latest }}"
 | 
			
		||||
 | 
			
		||||
- name: Determine Postgres version to use (use 9.x, if detected)
 | 
			
		||||
  set_fact:
 | 
			
		||||
    matrix_docker_image_postgres_to_use: "{{ matrix_docker_image_postgres_v9 }}"
 | 
			
		||||
    matrix_postgres_docker_image_to_use: "{{ matrix_postgres_docker_image_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: "matrix_docker_image_postgres_to_use == matrix_docker_image_postgres_latest"
 | 
			
		||||
  when: "matrix_postgres_docker_image_to_use == matrix_postgres_docker_image_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 \
 | 
			
		||||
    {{ matrix_docker_image_postgres_to_use }} pg_dump -h postgres {{ matrix_postgres_db_name }} -f /out/{{ postgres_dump_name }}
 | 
			
		||||
    {{ matrix_postgres_docker_image_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 \
 | 
			
		||||
    {{ matrix_docker_image_postgres_latest }} psql -h postgres -f /in/{{ postgres_dump_name }}
 | 
			
		||||
    {{ matrix_postgres_docker_image_latest }} psql -h postgres -f /in/{{ postgres_dump_name }}
 | 
			
		||||
 | 
			
		||||
- name: Delete Postgres database dump file
 | 
			
		||||
  file:
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,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 \
 | 
			
		||||
			{{ matrix_docker_image_coturn }} \
 | 
			
		||||
			{{ matrix_coturn_docker_image }} \
 | 
			
		||||
			-c /turnserver.conf
 | 
			
		||||
ExecStop=-/usr/bin/docker kill matrix-coturn
 | 
			
		||||
ExecStop=-/usr/bin/docker rm matrix-coturn
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,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 \
 | 
			
		||||
			{{ matrix_docker_image_goofys }} \
 | 
			
		||||
			{{ matrix_s3_goofys_docker_image }} \
 | 
			
		||||
			-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
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-mailer \
 | 
			
		||||
			--log-driver=none \
 | 
			
		||||
			--network={{ matrix_docker_network }} \
 | 
			
		||||
			--env-file={{ matrix_environment_variables_data_path }}/env-mailer \
 | 
			
		||||
			{{ matrix_docker_image_mailer }}
 | 
			
		||||
			{{ matrix_mailer_docker_image }}
 | 
			
		||||
ExecStop=-/usr/bin/docker kill matrix-mailer
 | 
			
		||||
ExecStop=-/usr/bin/docker rm matrix-mailer
 | 
			
		||||
Restart=always
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-mautrix-telegram \
 | 
			
		||||
			-e "UID={{ matrix_user_uid }}" -e "GID={{ matrix_user_gid }}" \
 | 
			
		||||
			--network={{ matrix_docker_network }} \
 | 
			
		||||
			-v {{ matrix_mautrix_telegram_base_path }}:/data:z \
 | 
			
		||||
			{{ matrix_docker_image_mautrix_telegram }}
 | 
			
		||||
			{{ matrix_mautrix_telegram_docker_image }}
 | 
			
		||||
ExecStop=-/usr/bin/docker kill matrix-mautrix-telegram
 | 
			
		||||
ExecStop=-/usr/bin/docker rm matrix-mautrix-telegram
 | 
			
		||||
Restart=always
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-mautrix-whatsapp \
 | 
			
		||||
			-e "UID={{ matrix_user_uid }}" -e "GID={{ matrix_user_gid }}" \
 | 
			
		||||
			--network={{ matrix_docker_network }} \
 | 
			
		||||
			-v {{ matrix_mautrix_whatsapp_base_path }}:/data:z \
 | 
			
		||||
			{{ matrix_docker_image_mautrix_whatsapp }}
 | 
			
		||||
			{{ matrix_mautrix_whatsapp_docker_image }}
 | 
			
		||||
ExecStop=-/usr/bin/docker kill matrix-mautrix-whatsapp
 | 
			
		||||
ExecStop=-/usr/bin/docker rm matrix-mautrix-whatsapp
 | 
			
		||||
Restart=always
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-mxisd \
 | 
			
		||||
			{% endif %}
 | 
			
		||||
			-v {{ matrix_mxisd_config_path }}:/etc/mxisd:ro \
 | 
			
		||||
			-v {{ matrix_mxisd_data_path }}:/var/mxisd \
 | 
			
		||||
			{{ matrix_docker_image_mxisd }}
 | 
			
		||||
			{{ matrix_mxisd_docker_image }}
 | 
			
		||||
ExecStop=-/usr/bin/docker kill matrix-mxisd
 | 
			
		||||
ExecStop=-/usr/bin/docker rm matrix-mxisd
 | 
			
		||||
Restart=always
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-nginx-proxy \
 | 
			
		||||
			-v {{ matrix_nginx_proxy_confd_path }}:/etc/nginx/conf.d:ro \
 | 
			
		||||
			-v {{ matrix_ssl_config_dir_path }}:{{ matrix_ssl_config_dir_path }}:ro \
 | 
			
		||||
			-v {{ matrix_static_files_base_path }}:{{ matrix_static_files_base_path }}:ro \
 | 
			
		||||
			{{ matrix_docker_image_nginx }}
 | 
			
		||||
			{{ matrix_nginx_proxy_docker_image }}
 | 
			
		||||
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
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,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 \
 | 
			
		||||
			{{ matrix_docker_image_postgres_to_use }}
 | 
			
		||||
			{{ matrix_postgres_docker_image_to_use }}
 | 
			
		||||
ExecStop=-/usr/bin/docker stop matrix-postgres
 | 
			
		||||
ExecStop=-/usr/bin/docker rm matrix-postgres
 | 
			
		||||
Restart=always
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,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 %}
 | 
			
		||||
			{{ matrix_docker_image_riot }}
 | 
			
		||||
			{{ matrix_riot_web_docker_image }}
 | 
			
		||||
ExecStop=-/usr/bin/docker kill matrix-riot-web
 | 
			
		||||
ExecStop=-/usr/bin/docker rm matrix-riot-web
 | 
			
		||||
Restart=always
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-synapse \
 | 
			
		||||
			{% for volume in matrix_synapse_container_additional_volumes %}
 | 
			
		||||
			-v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \
 | 
			
		||||
			{% endfor %}
 | 
			
		||||
			{{ matrix_docker_image_synapse }}
 | 
			
		||||
			{{ matrix_synapse_docker_image }}
 | 
			
		||||
ExecStop=-/usr/bin/docker kill matrix-synapse
 | 
			
		||||
ExecStop=-/usr/bin/docker rm matrix-synapse
 | 
			
		||||
Restart=always
 | 
			
		||||
 
 | 
			
		||||
@@ -5,5 +5,5 @@ docker run \
 | 
			
		||||
	--rm \
 | 
			
		||||
	--env-file={{ matrix_environment_variables_data_path }}/env-postgres-pgsql-docker \
 | 
			
		||||
	--network {{ matrix_docker_network }} \
 | 
			
		||||
	{{ matrix_docker_image_postgres_to_use }} \
 | 
			
		||||
	{{ matrix_postgres_docker_image_to_use }} \
 | 
			
		||||
	psql -h {{ matrix_postgres_connection_hostname }}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user