From cd2bf0bca6dfd05ac65e09d84a8d384af7e1ebfb Mon Sep 17 00:00:00 2001 From: Joshua Fernandes Date: Mon, 9 Dec 2019 07:43:48 +1000 Subject: [PATCH] adding in option to specify a custom node private key Signed-off-by: Joshua Fernandes --- README.md | 1 + defaults/main.yml | 1 + templates/config.toml.j2 | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 07079b5..e4b6750 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults | `besu_download_url` | https://bintray.com/hyperledger-org/besu-repo/download_file?file_path=besu-{{ besu_version }}.tar.gz | The download tar.gz file used. You can use this if you need to retrieve besu from a custom location such as an internal repository. | | `besu_install_dir` | /opt/besu | Path to install to | | `besu_config_dir` | /etc/besu | Path for default configuration | +| `besu_node_private_key_file` | "" | Path for node private key, if supplied. This needs to include the node key file name and path like so `/home/me/me_node/myPrivateKey`. If not supplied Besu will create one automatically | | `besu_data_dir` | /opt/besu/data | Path for data directory| | `besu_log_dir` | /var/log/besu | Path for logs | | `besu_profile_file` | /etc/profile.d/besu-path.sh | Path to allow loading Besu into the system PATH | diff --git a/defaults/main.yml b/defaults/main.yml index 0c00947..7fffa95 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,6 +11,7 @@ besu_download_url: "https://bintray.com/hyperledger-org/besu-repo/download_file? besu_base_dir: "/opt/besu" besu_install_dir: "{{ besu_base_dir }}/besu-{{ besu_version }}" besu_current_dir: "{{ besu_base_dir }}/current" +besu_node_private_key_file: "" besu_config_dir: "/etc/besu" besu_config_template: "config.toml.j2" besu_data_dir: "{{ besu_base_dir }}/data" diff --git a/templates/config.toml.j2 b/templates/config.toml.j2 index c055bb9..5de6b51 100644 --- a/templates/config.toml.j2 +++ b/templates/config.toml.j2 @@ -2,6 +2,11 @@ data-path="{{besu_data_dir}}" logging="{{besu_log_level}}" +# private_key +{% if besu_node_private_key_file != "" %} +node-private-key-file="{{besu_node_private_key_file}}" +{% endif %} + {% if besu_network.lower() in ["mainnet", "rinkeby", "goerli", "ropsten", "dev"] %} network="{{besu_network}}" {% else %}