This setup uses Terraform to provision servers on Hetzner Cloud (Hcloud) and Ansible to configure and deploy Polkadot full nodes.
- ED25519 ssh key generated with default filename
~/.ssh/id_ed25519.pub
or (ssh-keygen -t ed25519 -C "your_email@example.com") - HCloud API Token
Provision two servers on Hetzner Cloud with the required specifications to run Polkadot full nodes.
-
Source the environment variables
source .env.sh
-
Apply the Terraform configuration:
terraform apply
Use the init_polkadot_server.yml
playbook for initial server setup, which: configures the data path and exposes necessary ports.
ansible-playbook -i inventory.yml init_polkadot_server.yml --ask-become
NB: This playbook is idempotent, meaning it can be safely re-run without causing issues.
After the initial configuration, you can deploy a specific Polkadot release.
If you follow Gitops principle, specify the desired Polkadot version in the vars.yml file, for eg:
polkadot_version: "polkadot-stable2409"
Run the update playbook:
ansible-playbook -i inventory.yml update_polkadot_fullnode.yml --ask-become
Override the polkadot_version
variable directly when running the playbook
ansible-playbook -i inventory.yml update_polkadot_fullnode.yml --extra-vars "polkadot_version=polkadot-stable2409-1"
Ensure your inventory.yml
file contains the correct server details generated by Terraform.
The Terraform and Ansible processes are modular and can be independently re-executed as needed.