matrix-docker-ansible-deploy icon indicating copy to clipboard operation
matrix-docker-ansible-deploy copied to clipboard

Enabling traefik dashboard leads to ansible error

Open thomsbe opened this issue 1 year ago • 1 comments

Describe the bug I try to enable the traefik dashboard. After inserting the vars and running ansible, it leads to a ansible error:

TASK [galaxy/com.devture.ansible.role.traefik : Ensure provider.yml installed] ***********************
fatal: [matrix.tbaer.de]: FAILED! => 
  msg: |-
    An unhandled exception occurred while templating '{{ devture_traefik_provider_configuration_yaml | from_yaml | combine(devture_traefik_provider_configuration_extension, recursive=True) }}'. Error was a <class 'yaml.scanner.ScannerError'>, original message: while scanning for the next token
    found character '\t' that cannot start any token
      in "<unicode string>", line 14, column 1:
                    tls: false
        ^

PLAY RECAP **********************************
matrix.tbaer.de            : ok=19   changed=3    unreachable=0    failed=1    skipped=16   rescued=0    ignored=0   

error: Recipe `run` failed on line 38 with exit code 2
error: Recipe `install-service` failed on line 31 with exit code 2

Without the dashboard config it runs fine.

To Reproduce My vars.yml file looks like this:

devture_traefik_config_entrypoint_web_secure_enabled: false
devture_traefik_container_web_host_bind_port: '127.0.0.1:18080'

devture_traefik_additional_entrypoints_auto:
  - name: matrix-federation
    port: 18448
    host_bind_port: "127.0.0.1:18448"
    config: {}

devture_traefik_dashboard_enabled: true
devture_traefik_dashboard_hostname: "{{ matrix_server_fqn_matrix }}"
devture_traefik_dashboard_basicauth_enabled: true
devture_traefik_dashboard_basicauth_user: username
devture_traefik_dashboard_basicauth_password: 'somepassword'

Expected behavior Dashboards are enabled. At least, ansible runs without this error.

Matrix Server:

  • OS: debian 11 amd64

Ansible: Ansible runs on the host.

ansible 2.10.8
  config file = /opt/matrix-docker-ansible-deploy/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible

Additional context I'm running with traefik, fronted by Caddy2, because I have other services on the host, but I'm trying to migrate all those services to the traefik running in the playbook. On My way, I try to enable the dashboards to see what's going on.

thomsbe avatar Jul 10 '23 07:07 thomsbe

Adding to this as I'm having the same problem. I've narrowed it down to one line in the configs:

devture_traefik_config_entrypoint_web_secure_enabled causes an error when running the ansible playbook.

Edit: Adding some additional information. The playbook errors in galaxy/com.devture.ansible.role.traefik : Ensure provider.yml installed with the following error:

  msg: |-
    An unhandled exception occurred while templating '{{ devture_traefik_provider_configuration_yaml | from_yaml | combine(devture_traefik_provider_configuration_extension, recursive=True) }}'. Error was a <class 'yaml.scanner.ScannerError'>, original message: while scanning for the next token
    found character that cannot start any token
      in "<unicode string>", line 14, column 1

Turns out there is an error in devture.ansible.role.traefik which is addressed by this pull request:

https://github.com/devture/com.devture.ansible.role.traefik/pull/9

jasonlaguidice avatar Aug 04 '23 07:08 jasonlaguidice