Skip to content

Commit

Permalink
escape % char in systemd unit env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
alxgomz committed Sep 9, 2024
1 parent c2c7de1 commit faf0a3a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions roles/search_enterprise/templates/elasticsearch-cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Environment=ALFRESCO_ACCEPTED_CONTENT_MEDIA_TYPES_CACHE_BASE_URL=http://{{ trout
Environment=ELASTICSEARCH_INDEXNAME=alfresco
Environment=SPRING_ACTIVEMQ_BROKERURL=failover:({{ activemq_transport }}://{{ activemq_host }}:{{ ports_cfg.activemq[activemq_protocol] }})
Environment=SPRING_ACTIVEMQ_USER={{ activemq_username }}
Environment=SPRING_ACTIVEMQ_PASSWORD={{ activemq_password }}
Environment=SPRING_ACTIVEMQ_PASSWORD={{ activemq_password | regex_replace(systemd_service_unit_specifier_regex, '%%\1') }}
Environment=SPRING_ELASTICSEARCH_REST_URIS={{ elasticsearch_protocol }}://{{ elasticsearch_host }}:{{ ports_cfg.elasticsearch.http }}
Environment=SPRING_ELASTICSEARCH_REST_USERNAME={{ elasticsearch_username }}
Environment=SPRING_ELASTICSEARCH_REST_PASSWORD={{ elasticsearch_password }}
Environment=SPRING_ELASTICSEARCH_REST_PASSWORD={{ elasticsearch_password | regex_replace(search_enterprise_unit_specifier_regex, '%%\1') }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ User={{ username }}

Environment=SPRING_DATASOURCE_URL={{ repo_db_url if repo_db_url else 'jdbc:postgresql://' + db_host + ':' + ports_cfg.postgres.sql | string + '/' + repo_db_name }}
Environment=SPRING_DATASOURCE_USERNAME={{ repo_db_username }}
Environment=SPRING_DATASOURCE_PASSWORD={{ repo_db_password }}
Environment=SPRING_DATASOURCE_PASSWORD={{ repo_db_password | regex_replace(search_enterprise_unit_specifier_regex, '%%\1') }}

ExecStart={{ java_home }}/bin/java -jar {{ search_enterprise_binaries_dir }}/alfresco-elasticsearch-reindexing-{{ search_enterprise.version }}-app.jar {{ search_enterprise_reindex_options }}

Expand Down
2 changes: 2 additions & 0 deletions roles/search_enterprise/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
search_enterprise_binaries_dir: "{{ binaries_folder }}/enterprise-search-{{ search_enterprise.version }}"
search_enterprise_config_dir: "{{ config_folder }}/enterprise-search"
search_enterprise_data_dir: "{{ data_folder }}/enterprise-search"
# System list of uint specifiers https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#Specifiers
search_enterprise_unit_specifier_regex: '%([aAbBCdDEfgGhHiIjJlLmMnNopPqsStTuUvVwWyY%]|$)'

0 comments on commit faf0a3a

Please sign in to comment.