datastax / pulsar-ansible

Apache License 2.0
4 stars 9 forks source link

Environment variables for Pulsar processes should be in a key-value structure in group vars yaml #11

Open lhotari opened 2 years ago

lhotari commented 2 years ago

Currently in https://github.com/datastax/pulsar-ansible#32-customize-pulsar-jvm-settings-log-directory-and-data-directory there's an example:

bookie_jvm_options: >
 {% if customize_jvm is defined and customize_jvm|bool %}PULSAR_MEM="{{ pulsar_mem_bookie }}" {% endif %}
 PULSAR_EXTRA_OPTS="-XX:+PerfDisableSharedMem"
 PULSAR_GC="-XX:+UseG1GC -XX:MaxGCPauseMillis=10"
 PULSAR_GC_LOG="-Xlog:gc*,safepoint:{{ tgt_pulsar_gc_log_homedir }}/pulsar_gc_%p.log:time,uptime,tags:filecount=10,filesize=20M"
 PULSAR_LOG_DIR="{{ tgt_pulsar_log_homedir }}/bookkeeper

This is not modeled in an optimal way for the systemd migration, #2 .

Instead of using a text field for storing the configuration, a key-value pair (dictionary) data structure should be used.

example of updated configuration:

bookie_jvm_options:
 {% if customize_jvm is defined and customize_jvm|bool %}PULSAR_MEM: "{{ pulsar_mem_bookie }}" {% endif %}
 PULSAR_EXTRA_OPTS: "-XX:+PerfDisableSharedMem"
 PULSAR_GC: "-XX:+UseG1GC -XX:MaxGCPauseMillis=10"
 PULSAR_GC_LOG: "-Xlog:gc*,safepoint:{{ tgt_pulsar_gc_log_homedir }}/pulsar_gc_%p.log:time,uptime,tags:filecount=10,filesize=20M"
 PULSAR_LOG_DIR: "{{ tgt_pulsar_log_homedir }}/bookkeeper"

The naming should be adjusted too. Instead of calling it _jvm_options, it should be _environment. Systemd has direct support for setting environment variables.