ebbba-org / ansible-role-bigbluebutton

Ansible role for a bigbluebutton installation (following the documentation on https://docs.bigbluebutton.org/administration/install and https://github.com/bigbluebutton/bigbluebutton)
https://www.ebbba.org/
MIT License
125 stars 82 forks source link

[BUG] - Ansible has problems with + in jinja2 templates to preserve new lines #297

Closed dimitrihof closed 2 years ago

dimitrihof commented 2 years ago

Describe the bug Role isn't running because of the following error

"msg": "AnsibleError: template error while templating string: expected token 'end of statement block', got '+'. String: #// include default config from upstream\ninclude \"/usr/share/bbb-apps-akka/conf/application.conf\"\n\n#// you can customize everything here. API endpoint and secret have to be changed\n#// This file will not be overridden by packages\nakka {\n  actor {\n    debug {\n      # enable DEBUG logging of all AutoReceiveMessages (Kill, PoisonPill et.c.)\n      autoreceive = {% if bbb_apps_akka_log_level == 'DEBUG' %}on{% else +%}off{% endif +%}\n      # enable DEBUG logging of actor lifecycle changes\n      lifecycle = {% if bbb_apps_akka_log_level == 'DEBUG' %}on{% else +%}off{% endif +%}\n    }\n  }\n  loggers = [\"akka.event.slf4j.Slf4jLogger\"]\n  loglevel = \"{{ bbb_apps_akka_log_level }}\"\n}\n\nservices {\n  bbbWebAPI=\"https://{{ bbb_hostname }}/bigbluebutton/api\"\n  sharedSecret=\"{{ bbb_secret }}\"\n}\n"
}

Expected behavior Run role as a whole without error.

Screenshots If applicable, add screenshots to help explain your problem. DO NOT USE SCREENSHOTS TO SHOW CODE! This makes the information inaccessible to visually impaired users.

Desktop information if needed (please complete the following information):

Ansible version ansible [core 2.12.2] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/d3h/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/d3h/anaconda3/lib/python3.9/site-packages/ansible ansible collection location = /home/d3h/.ansible/collections:/usr/share/ansible/collections executable location = /home/d3h/anaconda3/bin/ansible python version = 3.9.7 (default, Sep 16 2021, 13:09:58) [GCC 7.5.0] jinja version = 2.11.3 libyaml = True

Your variables for this role - be sure to remove any sensitive information

- hosts: bbb
  remote_user: root
  roles:
    - role: ../roles/ansible-role-bigbluebutton
      bbb_hostname: "{{ fqdn }}"
#      bbb_version: bionic-230
      bbb_state: latest
#      bbb_apt_mirror:
      bbb_letsencrypt_enable: "true"
      bbb_letsencrypt_email: "xxx"
#      bbb_letsencrypt_api:
#      bbb_nginx_privacy:
#      bbb_nginx_listen_https:
#      bbb_nginx_root:
#      bbb_ssl_cert:
#      bbb_ssl_key:
#      bbb_own_cert:
#      bbb_own_key:
      bbb_default_welcome_message: ''
#      bbb_default_presentation:
#      bbb_custom_presentation:
#      bbb_custom_presentation_name:
#      bbb_web_logouturl: ""
#      bbb_allow_request_without_session:
      bbb_coturn_enable: false
      bbb_coturn_server: false
#      bbb_coturn_port:
#      bbb_coturn_port_tls:
      bbb_coturn_secret: "{{ vault_turn_secret }}"
#      bbb_coturn_min_port:
#      bbb_coturn_max_port:
      bbb_turn_enable: true
      bbb_stun_servers:
       - server: "{{ vault_turnserver }}"
       - server: "{{ vault_turnserver }}:443"
#      bbb_ice_servers:
      bbb_turn_servers:
        - server: "{{ vault_turnserver }}"
          port: 3478
          transport: udp
          secret: "{{ vault_turn_secret }}"
          tls: false
        - server: "{{ vault_turnserver }}"
          port: 443
          transport: tcp
          secret: "{{ vault_turn_secret }}"
          tls: false
        - server: "{{ vault_turnserver }}"
          port: 5349
          transport: tcp
          secret: "{{ vault_turn_secret }}"
          tls: true
#      bbb_greenlight_enable: false
#      bbb_greenlight_hosts:
#      bbb_greenlight_image:
#      bbb_greenlight_secret: "{{ vault_greenlight_secret }}"
#      bbb_greenlight_db_password: "{{ vault_greenlight_db_password }}"
#      bbb_greenlight_default_registration: "invite"
#      bbb_greenlight_users:
#       - "{{ vault_greenlight_user }}"
#      bbb_allow_mail_notifications: "false"
#      bbb_disable_recordings:
      bbb_api_demos_enable: true
#      bbb_client_log_enable:
#      bbb_mute_on_start:
#      bbb_app_log_level:
      bbb_meteor:
        public:
          app:
            skipCheck: false
            # Skips the echo test when connecting with microphone right after user
            # joins the room the first time. Subsequents joins  to microphone won't
            # have echo test skipped, for example if user leave and join mic again
            # or reloading page and joining mic again.
            # This setting won't have effect if skipCheck = true
            skipCheckOnJoin: true
            helpLink: 
            breakouts:
              breakoutRoomLimit: 50
              sendInvitationToIncludedModerators: false
                # fallbackLocale: if the locale the client is loaded in does not have a
                # translation a string, it will use the translation from the locale
                # specified in fallbackLocale. Note that fallbackLocale should be a
                # 100% translated locale for best user experience
            connectionTimeout: 60000
          kurento:
            wsUrl: wss://{{ fqdn }}/bbb-webrtc-sfu
            screenshare:
              bitrate: 1500
              mediaTimeouts:
                maxConnectionAttempts: 2
                # Base screen media timeout (send|recv)
                baseTimeout: 30000
                # Max timeout: used as the max camera subscribe reconnection timeout. Each
                # subscribe reattempt increases the reconnection timer up to this
                maxTimeout: 60000
                timeoutIncreaseFactor: 1.5
              constraints:
                video:
                  frameRate:
                    ideal: 20
                    max: 30
                  width:
                    max: 1980
                  height:
                    max: 1050
                audio: true
          note:
            enabled: true
            url: https://{{ fqdn }}/pad
            # cameraProfiles is an array of:
            # - id: profile identifier
            #   name: human-readable profile name
            #   bitrate
            #   hidden: whether this profile will be hidden in the video preview dropdown
            #   constraints: a video media constraints dictionary (without the video key)
            cameraProfiles:
              # id: unique identifier of the profile
              # name: name of the profile visible to users
              # default: if this is the default profile which is pre-selected
              # bitrate: the average bitrate for used for a webcam stream
              # constraints:
              #   # Optional constraints put on the requested video a browser MAY honor
              #   # For a detailed list on possible values see:
              #   # https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints
              #   # Examples:
              #   width: requested width of the camera stream
              #   frameRate: requested framerate
              - id: low-u30
                name: low-u30
                bitrate: 30
                hidden: true
                constraints:
                  frameRate: 3
              - id: low-u25
                name: low-u25
                bitrate: 40
                hidden: true
                constraints:
                  frameRate: 3
              - id: low-u20
                name: low-u20
                bitrate: 50
                hidden: true
                constraints:
                  frameRate: 5
              - id: low-u15
                name: low-u15
                bitrate: 70
                hidden: true
                constraints:
                  frameRate: 8
              - id: low-u12
                name: low-u12
                bitrate: 90
                hidden: true
                constraints:
                  frameRate: 10
              - id: low-u8
                name: low-u8
                bitrate: 100
                hidden: true
                constraints:
                  frameRate: 10
              - id: low
                name: Low
                default: false
                bitrate: 100
              - id: medium
                name: Medium
                default: true
                bitrate: 200
              - id: high
                name: High
                default: false
                bitrate: 500
                constraints:
                  width: 1280
                  frameRate: 15
              - id: hd
                name: High definition
                default: false
                bitrate: 800
                constraints:
                  width: 1280
                  frameRate: 30
#      bbb_nodejs_version:
#      bbb_system_locale:
      bbb_secret: "{{ vault_api_secret }}"
      bbb_freeswitch_ipv6: true
#      bbb_freeswitch_ip_address:
#      bbb_freeswitch_external_ip:
#      bbb_dialplan_quality:
#      bbb_dialplan_energy_level: "100"
#      bbb_dialplan_comfort_noise:
      bbb_webhooks_enable: true
#      bbb_check_for_running_meetings:
#      bbb_monitoring_all_in_one_enable:
#      bbb_monitoring_all_in_one_version:
#      bbb_monitoring_all_in_one_port:
#      bbb_monitoring_all_in_one_grafana:
#      bbb_monitoring_all_in_one_prometheus:
#      bbb_monitoring_recordings_from_disk:
#      bbb_monitoring_external: "true"
#      bbb_monitoring_htpasswd_user: "{{ vault_monitoring_htpasswd_user }}"
#      bbb_monitoring_htpasswd: "{{ vault_monitoring_htpasswd }}"
#      bbb_monitoring_exporter_version:
#      bbb_monitoring_systemd_enable:
#      bbb_monitoring_systemd_directory:
#      bbb_monitoring_systemd_port:
#      bbb_monitoring_systemd_bind_ip:
#      bbb_dialin_enabled:
#      bbb_dialin_provider_proxy:
#      bbb_dialin_provider_username:
#      bbb_dialin_provider_password:
#      bbb_dialin_provider_extension:
#      bbb_dialin_default_number:
#      bbb_dialin_mask_caller:
#      bbb_dialin_default_play_and_get_digitsbbb_dialin_overwrite_footer:
#      bbb_dialin_footer:
#      bbb_guestpolicy:
#      bbb_ntp_cron:
#      bbb_ntp_cron_day:
#      bbb_ntp_cron_hour:
#      bbb_ntp_cron_minute:
      bbb_cron_history: "1"
      bbb_cron_unrecorded_days: "1"
      bbb_cron_published_days: "7"
      bbb_cron_log_history: 7
#      bbb_html5_node_options:
      bbb_freeswitch_socket_password: "{{ vault_freeswitch_socket_password }}"
      bbb_freeswitch_default_password: "{{ vault_freeswitch_default_password }}"
      bbb_html5_backend_processes: 1
      bbb_html5_frontend_processes: 1
#      bbb_container_compat:
#      bbb_firewall_ufw:
#      bbb_ufw_allow_networks_custom:
#      bbb_ufw_reject_networks_custom:
      bbb_ssh_port: xxxx
#      bbb_max_file_size_upload:
#      bbb_default_max_users:
#      bbb_default_meeting_duration:
#      bbb_max_num_pages:
#      bbb_max_conversion_time:
#      bbb_num_conversion_threads:
#      bbb_num_file_processor_threads:
#      bbb_freeswitch_muted_sound:
#     bbb_freeswitch_unmuted_sound:
#     bbb_breakout_rooms_enabled:
#     bbb_breakout_rooms_record:
#     bbb_breakout_rooms_privatechat_enabled:
#     bbb_docker_compose_version:
#     bbb_docker_passwd:
#     bbb_docker_user:
      bbb_learning_dashboard_enabled: false
dimitrihof commented 2 years ago

so i found out that there is another way to achieve this https://github.com/ansible/ansible/issues/22531 Adding #jinja2: trim_blocks:False to the beginning of the template preservers new lines as well and keeps readability.

I don't know if thats a specific bug with my ansible version or if it's a general thing.

According to the issue in ansible adding + signs should be valid in jinja2, but i couldn't find anything about it in the documentation.

dimitrihof commented 2 years ago

Added a pull request https://github.com/ebbba-org/ansible-role-bigbluebutton/pull/298

BrutalBirdie commented 2 years ago

huh. I never had this issue but I guess this does not hurt anyone. 👍🏻

BrutalBirdie commented 2 years ago

@d3hof is this solved with PR #294