reverting cmdline_args as quotes, env_opts strings

pull/20/head
Joshua Fernandes 5 years ago
parent 1de1d73ca3
commit 981f47454a
  1. 2
      README.md
  2. 2
      defaults/main.yml
  3. 18
      filter_plugins/besu_filters.py
  4. 4
      templates/besu.service.j2

@ -82,7 +82,7 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults
| `besu_permissions_accounts_contract_address` | ___unset___ | The contract address for onchain accounts permissioning |
| `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` |
| `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` |
| `orion_version` | ___unset___ | Version of Orion installed. When supplied, adds required privacy config items and requires `orion_config_dir` and `orion_key_name` to be set |
| `orion_config_dir` | ___unset___ | Path to Orion configuration directory |
| `orion_key_name` | ___unset___ | Name of the Node Key |

@ -60,7 +60,7 @@ besu_metrics_port: 9545
besu_bootnodes: []
besu_host_whitelist: ["*"]
besu_cmdline_args: ""
besu_env_opts: []
besu_env_opts: ""
# internal state to maintain idempotency
besu_state_updates: []

@ -1,18 +0,0 @@
#! /usr/bin/env python
from typing import Union, List
class FilterModule(object):
def filters(self):
return {
'besu_opts_format': self.besuOptsFormat,
}
def besuOptsFormat(self, besu_env_opts: Union[str, List[str]]):
if isinstance(besu_env_opts, str):
besu_env_opts = besu_env_opts.split()
escaped_besu_env_opts = [item.replace('"', '\\"') for item in besu_env_opts]
return f'''"{'" "'.join(escaped_besu_env_opts)}"'''

@ -10,11 +10,11 @@ Environment=HOME=/home/{{ besu_user }}
Environment=LOG4J_CONFIGURATION_FILE={{ besu_log4j_config_file }}
{% endif %}
{% if besu_env_opts %}
Environment='BESU_OPTS={{ besu_env_opts|besu_opts_format }}'
Environment='BESU_OPTS={{ besu_env_opts }}'
{% endif %}
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|quote }} >> {{besu_log_dir}}/besu.log 2>&1"
ExecStart=/bin/sh -c "{{ besu_current_dir }}/bin/besu --config-file={{ besu_config_dir }}/config.toml {{ besu_cmdline_args }} >> {{besu_log_dir}}/besu.log 2>&1"
{% else %}
ExecStart=/bin/sh -c "{{ besu_current_dir }}/bin/besu --config-file={{ besu_config_dir }}/config.toml >> {{besu_log_dir}}/besu.log 2>&1"
{% endif %}

Loading…
Cancel
Save