Add the possibility to set environment variables when starting Besu (#38)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
pull/39/head 0.3.11
Fabio Di Fabio 2 years ago committed by GitHub
parent c951bfc43e
commit f7a0ce08e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      README.md
  2. 1
      defaults/main.yml
  3. 3
      templates/besu.service.j2

@ -91,6 +91,7 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults
| `besu_permissions_nodes_contract_address` | ___unset___ | The contract address for onchain nodes permissioning |
| `besu_cmdline_args` | "" | Command line args that are passed in as overrides |
| `besu_env_opts` | [] | Settings passed to the JVM through `BESU_OPTS` environment variable. eg: `[-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005]s` |
| `besu_env_vars` | {} | Dictionary with environment variables to set when running Besu as systemd service. eg: `{MALLOC_ARENA_MAX: 2}` |
| `besu_privacy_enabled` | false | Enable privacy |
| `besu_privacy_url` | "" | URL to contact Orion on including port eg: `http://localhost:8888` |
| `besu_privacy_public_key_file` | ""| Path to Orion public key |

@ -62,6 +62,7 @@ besu_bootnodes: []
besu_host_whitelist: ["*"]
besu_cmdline_args: []
besu_env_opts: []
besu_env_vars: {}
besu_permissions_nodes_contract_version: 2
besu_xdns_enabled: "false"
besu_static_nodes_file: ""

@ -12,6 +12,9 @@ Environment=LOG4J_CONFIGURATION_FILE={{ besu_log4j_config_file }}
{% if besu_env_opts %}
Environment='BESU_OPTS={{besu_env_opts|map('to_json')|join(' ')}}'
{% endif %}
{% for key, value in besu_env_vars.items() %}
Environment='{{ key }}={{ value }}'
{% endfor %}
Type=simple
{% if besu_cmdline_args %}
ExecStart=/bin/sh -c "{{ besu_current_dir }}/bin/besu --config-file={{ besu_config_dir }}/config.toml {{besu_cmdline_args|map('to_json')|join(' ')|regex_replace('"','')}} >> {{besu_log_dir}}/besu.log 2>&1"

Loading…
Cancel
Save