matrix-docker-ansible-deploy
matrix-docker-ansible-deploy copied to clipboard
Issue with "matrix-nginx-proxy : Ensure matrix-nginx-proxy.service installed"
Describe the bug
Dear all, I just pulled the repo and tried to update my instance with ansible-playbook -i inventory/hosts setup.yml -K --tags=setup-all,start as usual.
I got this error:
TASK [matrix-nginx-proxy : Ensure matrix-nginx-proxy.service installed] *************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: : the inline if-expression on line 4 evaluated to false and no else section was defined.
fatal: [matrix.***********]: FAILED! => changed=false
msg: |-
AnsibleUndefinedVariable: {{
['matrix-' + matrix_homeserver_implementation + '.service']
+
(matrix_synapse_webserving_workers_systemd_services_list if matrix_homeserver_implementation == 'synapse' and matrix_synapse_workers_enabled)
+
(['matrix-corporal.service'] if matrix_corporal_enabled else [])
+
(['matrix-ma1sd.service'] if matrix_ma1sd_enabled else [])
+
(['matrix-client-cinny.service'] if matrix_client_cinny_enabled else [])
+
(['matrix-bot-buscarron.service'] if matrix_bot_buscarron_enabled else [])
+
(['matrix-client-element.service'] if matrix_client_element_enabled else [])
+
(['matrix-client-hydrogen.service'] if matrix_client_hydrogen_enabled else [])
+
(['matrix-grafana.service'] if matrix_grafana_enabled else [])
+
(['matrix-dimension.service'] if matrix_dimension_enabled else [])
+
(['matrix-sygnal.service'] if matrix_sygnal_enabled else [])
+
(['matrix-ntfy.service'] if matrix_ntfy_enabled else [])
+
(['matrix-jitsi.service'] if matrix_jitsi_enabled else [])
+
(['matrix-bot-go-neb.service'] if matrix_bot_go_neb_enabled else [])
+
(['matrix-etherpad.service'] if matrix_etherpad_enabled and matrix_dimension_enabled else [])
+
(['matrix-hookshot.service'] if matrix_hookshot_enabled else [])
}}
: the inline if-expression on line 4 evaluated to false and no else section was defined.
PLAY RECAP **************************************************************************************************************************************************
matrix.************* : ok=277 changed=19 unreachable=0 failed=1 skipped=1863 rescued=0 ignored=0
To Reproduce
My vars.yml file looks like this:
Nothing fancy, I just use Traefik as a reverse proxy.
matrix_domain: *******************
matrix_homeserver_implementation: synapse
matrix_ssl_lets_encrypt_support_email: '***************'
matrix_coturn_turn_static_auth_secret: '***************'
matrix_synapse_macaroon_secret_key: '***************'
matrix_postgres_connection_password: '***************'
matrix_client_element_enabled: false
matrix_homeserver_generic_secret_key: "{{ matrix_synapse_macaroon_secret_key }}"
# =================================================================================================
# Disable Nginx and use Traefik instead
# =================================================================================================
# Disable generation and retrieval of SSL certs
matrix_ssl_retrieval_method: none
# Configure Nginx to only use plain HTTP
matrix_nginx_proxy_https_enabled: false
# Don't bind any HTTP or federation port to the host
# (Traefik will proxy directly into the containers)
matrix_nginx_proxy_container_http_host_bind_port: ''
matrix_nginx_proxy_container_federation_host_bind_port: ''
# Disable Coturn because it needs SSL certs
# (Clients can, though exposing IP address, use Matrix.org TURN)
matrix_coturn_enabled: false
# All containers need to be on the same Docker network as Traefik
# (This network should already exist and Traefik should be using this network)
matrix_docker_network: 't2_proxy'
matrix_nginx_proxy_container_extra_arguments:
- '--label "traefik.enable=true"'
- '--label "traefik.http.routers.matrix-nginx-proxy.entrypoints=https"'
- '--label "traefik.http.routers.matrix-nginx-proxy.rule=Host(`{{ matrix_server_fqn_matrix }}`,`{{ matrix_server_fqn_element }}`,`{{ matrix_server_fqn_dimension }}`,`{{ matrix_server_fqn_jitsi }}`)"'
- '--label "traefik.http.routers.matrix-nginx-proxy.tls=true"'
- '--label "traefik.http.services.matrix-nginx-proxy.loadbalancer.server.port=8080"'
# - '--label "traefik.http.routers.matrix-nginx-proxy.middlewares=matrix-regex"'
# - '--label "traefik.http.middlewares.matrix-regex.redirectregex.regex=https://matrix.***************/.well-known/matrix/(client|server)"'
# - '--label "traefik.http.middlewares.matrix-regex.redirectregex.replacement=https://matrix.***************/"'
matrix_synapse_container_extra_arguments:
- '--label "traefik.enable=true"'
- '--label "traefik.http.routers.matrix-synapse.entrypoints=synapse"'
- '--label "traefik.http.routers.matrix-synapse.rule=Host(`{{ matrix_server_fqn_matrix }}`)"'
- '--label "traefik.http.routers.matrix-synapse.tls=true"'
- '--label "traefik.http.routers.matrix-synapse.service=matrix-synapse"'
- '--label "traefik.http.services.matrix-synapse.loadbalancer.server.port=8048"'
# =================================================================================================
# Setting up the Shared Secret Auth password provider module
matrix_synapse_ext_password_provider_shared_secret_auth_enabled: true
matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret: *********************
# =================================================================================================
# Bridges
# =================================================================================================
# Slack
# matrix_appservice_slack_enabled: true
# matrix_appservice_slack_control_room_id: "**********************"
matrix_mx_puppet_slack_enabled: true
matrix_mx_puppet_slack_oauth_client_id: "*********************"
matrix_mx_puppet_slack_oauth_client_secret: "********************"
# WhatsApp
matrix_mautrix_whatsapp_enabled: true
# Signal
matrix_mautrix_signal_enabled: true
# Facebook
matrix_mautrix_facebook_enabled: true
# Telegram
matrix_mautrix_telegram_enabled: true
matrix_mautrix_telegram_api_id: ******
matrix_mautrix_telegram_api_hash: ****************************
Matrix Server:
thomas@homelab:[~]: lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
thomas@homelab:[~]: uname -a
Linux homelab 5.4.0-125-generic #141-Ubuntu SMP Wed Aug 10 13:42:03 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Ansible: I run Ansible from my Archlinux machine (separated from my server).
[thomas@laptop ~]$ ansible --version
ansible [core 2.13.3]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/thomas/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.10/site-packages/ansible
ansible collection location = /home/thomas/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.10.6 (main, Aug 3 2022, 17:39:45) [GCC 12.1.1 20220730]
jinja version = 3.1.2
libyaml = True
Cheers