Skip to content

Docker image for the elixir chain in cosmos ecosysmtem

Notifications You must be signed in to change notification settings

axol-io/ansible-elixir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansible-elixir

Ansible role to manage elixir nodes

Table of Contents

Introduction to Ansible

Ansible is an open-source automation tool that simplifies the process of configuration management, application deployment, and task automation. It uses a simple, human-readable language (YAML) to describe automation jobs, which allows you to manage complex deployments easily.

Why Use Ansible?

  • Agentless: No need to install any software on the nodes you manage.
  • Simple: Uses YAML for configuration, which is easy to read and write.
  • Powerful: Can manage complex deployments and configurations.

Prerequisites

Before you start, ensure you have the following:

  • A machine with Ansible installed (control node).
  • SSH access to the target machines (managed nodes).

Installing Ansible

To install Ansible on your control node, follow these steps:

Ubuntu

sudo apt update
sudo apt install ansible

macOS

brew install ansible

For other operating systems, refer to the Ansible installation guide.

Setting Up Your Environment

  1. Clone the Repository:

    git clone https://github.com/your-repo/ansible-elixir.git
    cd ansible-elixir
  2. Create a Virtual Environment (optional but recommended):

    python3 -m venv venv
    source venv/bin/activate
  3. Install Required Ansible Collections:

    ansible-galaxy install -r requirements.yml
  4. Modify the Ansible Configuration File:

    Edit the ansible.cfg file to set the inventory path and any other necessary configurations. Here is an example of what you might need to add or modify:

    [defaults]
    inventory = ./inventory
    remote_user = root
    private_key_file = ~/.ssh/id_ed25519
    host_key_checking = False

    This configuration sets the inventory file path, remote user, private key file, and disables host key checking.

Secret Management

Directory Structure Architecture Diagram

To manage your secrets, create a <Server-IP>.yml file and populate it with the necessary credentials. This file should be kept secure and not committed to version control (i.e. add to your .gitignore).

We recommend backing up your secrets using 1Password for simple secret storage.

mkdir host_vars && cd host_vars && touch IP.yml

Copy below into IP.yml. Not all values are required.

telegram_bot_token: "********"
telegram_chat_id: "********"
private_key_path: "/Path/.ssh/id_rsa"
IP: 10.101.10.101
WALLET_PRIVATE_KEY: "********"
WALLET_ADDRESS: "Address"
GRAFANA_ADMIN_PASSWORD: "********"
server_name: "example-01.axol.io"

Running Ansible Inventory

Inventory example

#IP of Host
[servers]
IP ansible_user=root ansible_ssh_private_key_file=~/.ssh/id_rsa

To run the Ansible inventory, use the following command:

ansible-playbook -i inventory main.yml

This command will execute the playbook defined in main.yml using the hosts specified in the inventory file.

Health Check examples

curl http://localhost:17690/health | jq

{
  "status": "OK",
  "started_at": "2024-10-13 09:44:39",
  "data_frame_version": "1.0.1",
  "order_proposal_version": "1.0.1",
  "app_version": "3.5.1",
  "display_name": "Axol",
  "beneficiary": "0xc74f57c8AB7Fd9f7dA37536dE3f75CB6763D32BE",
  "validator_address": "0xc74f57c8AB7Fd9f7dA37536dE3f75CB6763D32BE",
  "broker_url": "validator.testnet-3.elixirdev.xyz:9092",
  "api url": "https://api.testnet-3.elixir.xyz"
}

root@Elixir:~# curl https://api.testnet-3.elixir.xyz/health/ | jq

{
  "status": "up"
}

Additional Resources

Contribution Guidelines

Please read our contribution guidelines for details on our code of conduct, and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changelog

All notable changes to this project will be documented in this file. See CHANGELOG for details.

About

Docker image for the elixir chain in cosmos ecosysmtem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published