This Ansible playbook automates the deployment and configuration of Avail Node. It ensures that the necessary dependencies, configuration files, and services are properly set up and running.
Before using this playbook, ensure the following requirements are met:
- Ansible version: Make sure you have Ansible 2.15+ installed.
- SSH Access: Passwordless SSH access to all target servers.
- Python: Python 3.x installed on the control node and all target hosts.
- Privileges: The user running the playbook must have sudo privileges on the target machines.
Note: The following ansible playbook dynamically fetches private validator and node keys from hashicorp vault.
If Ansible is not installed, visit the official documentation for detailed instructions on how to install Ansible on various Linux distributions:
Clone this repository to your Ansible control node:
git clone https://github.com/encapsulate-xyz/avail-ansible.git
cd avail-ansibleDefine your target servers' IP address or DNS in the inventory folder, and select either mainnet.yml or testnet.yml to update.
Example for testnet.yml
---
all:
vars:
env: testnet
children:
avail:
hosts:
validator.avail.testnet.encapsulate.xyz:
type: validator
fullnode.avail.testnet.encapsulate.xyz:
type: fullnodeThis playbook allows customization through several variables. You can define these variables in the following locations:
group_vars/all.yml: Contains all the source urls and configurations.group_vars/mainnet.ymlorgroup_vars/testnet.yml: Contains version-specific variables.group_vars/vault.yml: Store secret variables, such asjwtsecret, in this file.
- First, install the dependencies:
ansible-galaxy install -r requirements.yml-
Create a
ansible_vault_passwordfile containing ansible-vault password -
Then run the playbook:
ansible-playbook node.yml -l validator.avail.testnet.encapsulate.xyzAfter you run the playbook, it will ask for confirmation, displaying all the variables and the IP address or DNS of the server you are going to deploy.
Example output:
TASK [Display environment being deployed to] ***************************************************************************************************
ok: [validator.avail.testnet.encapsulate.xyz] => {
"msg": [
"Deploying to Host: validator.avail.testnet.encapsulate.xyz",
"Groups: ['avail']",
"Project: avail",
"Environment: testnet",
"Type: validator",
"Version: v2.2.5.1",
"Username: avail",
"Service Name: avail",
"Operating System: linux",
"System Architecture: amd64"
]
}
TASK [Confirm deployment details] ********************************************************************************************************************
Pausing for 40 seconds
(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)
ok: [validator.avail.testnet.encapsulate.xyz]
TASK [Please confirm again] ********************************************************************************************************************
ok: [validator.avail.testnet.encapsulate.xyz] => {
"msg": [
"Deploying to Host: validator.avail.testnet.encapsulate.xyz",
"Project: avail",
"Environment: testnet",
"Type: validator"
]
}
TASK [Confirm deployment details] **************************************************************************************************************
Pausing for 20 seconds
(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)
ok: [validator.avail.testnet.encapsulate.xyz]