Use a template option for the env with variable extension

This commit is contained in:
Julian-Samuel Gebühr 2022-09-04 09:09:09 +02:00 committed by TheOneWithTheBraid
parent b4fdc622fd
commit bdfd84e146
3 changed files with 11 additions and 7 deletions

View File

@ -39,9 +39,10 @@ matrix_ldap_registration_proxy_systemd_required_services_list: ['docker.service'
# List of systemd services that matrix_ldap_registration_proxy.service wants # List of systemd services that matrix_ldap_registration_proxy.service wants
matrix_ldap_registration_proxy_systemd_wanted_services_list: [] matrix_ldap_registration_proxy_systemd_wanted_services_list: []
# Default LDAP configuration template which covers the generic use case. # Additional environment variables to pass to the LDAP proxy environment variables.
# You can customize it by controlling the various variables inside it. #
matrix_ldap_registration_proxy_configuration_env: "{{ lookup('template', 'templates/ldap-registration-proxy.env.j2') }}" # Example:
# matrix_ldap_registration_proxy_env_variables_extension: |
# KEY=value
matrix_ldap_registration_proxy_env_variables_extension: ''
# Holds the final LDAP configuration (a combination of the default and its extension).
matrix_ldap_registration_proxy_configuration: "{{ matrix_ldap_registration_proxy_configuration_env }}"

View File

@ -37,8 +37,8 @@
when: true when: true
- name: Ensure matrix_ldap_registration_proxy config installed - name: Ensure matrix_ldap_registration_proxy config installed
ansible.builtin.copy: ansible.builtin.template:
content: "{{ matrix_ldap_registration_proxy_configuration }}" src: "{{ role_path }}/templates/ldap-registration-proxy.env.j2"
dest: "{{ matrix_ldap_registration_proxy_config_path }}/ldap-registration-proxy.env" dest: "{{ matrix_ldap_registration_proxy_config_path }}/ldap-registration-proxy.env"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"

View File

@ -30,3 +30,6 @@ MATRIX_SERVER_URL={{ matrix_ldap_registration_proxy_matrix_server_url }}
# Specify the port to listen on. Default to 8080 # Specify the port to listen on. Default to 8080
LISTEN_PORT={{ matrix_ldap_registration_proxy_container_port }} LISTEN_PORT={{ matrix_ldap_registration_proxy_container_port }}
# Use this to extend the configuration with custom variables
{{ matrix_ldap_registration_proxy_env_variables_extension }}