Ansible
Introduction
This role was made with the main purpouse of deployng the RSKj node in hosts provisioned by the rsk-node Terraform module.
How to use
Add the server(s) to the inventory, modify variables to suits your needs and run playbook like this:
$ ansible-playbook -i inventory -u ubuntu deploy-rsk-node.yml
Tasks
Installs and a configure a released rskj
version.
- Installs OpenJDK.
- Adds
rsk
user for runningrskj
. - Creates required directories and sets the right ownership.
- Fetches released RSK version and checks its PGP signature.
- Fetches a specific build of RSK available in some artifacts repo.
- Copies configuration files.
- Adds
rsk
SystemD service and ensures it's up and running.
Group vars
rsk_network
: the symbolic name of the network. Must be one ofMainNet
,TestNet
orRegTest
.rsk_blockchain_name
: the name of the network as expected byblockchain.config.name
configuration option. Must be one ofmain
,testnet
orregtest
.
Files
AEIDELMAN.txt
,rsk-release-signing-key.asc
: PGP signing keys.logback.xml
: logging configuration file.
Handlers
Restart RSK
: triggered on JAR change or configurations changes.
Templates
node.conf.j2
:rskj
config file. Setsblockchain.name
anddatabase.dir
, overrides defaultpeer.connection.timeout
, adds host's DNS name and all its IP addresses for RPC.rsk.env.j2
: options for overridingrsk.system
SystemD unit file values, to avoid runningsystemctl daemon-reload
after modifying the service file.rsk.system.j2
: SystemD unit file for RSK.
Defaults
-
rskj_install_dir
: wherersk.jar
is stored. -
rskj_workdir
: where to download RSK JAR and PGP keys for verification. -
rskj_cfg_dir
: where RSK config files are stored. -
rskj_data_dir
: where RSK DB is stored. -
rskj_logs_dir
: where RSK logs are stored. -
rskj_release_download_base_url
: URLs to fetch the JAR. -
rskj_version_number
,rskj_version_codename
: the RSK release version number and codename, used to compute the release tag and the release JAR name. -
rskj_release_tag
,rskj_download_jar
: computed from previous.