/devops-ansible-task

This repo for managing some DEVOPS tasks with ansible

Primary LanguageHCL

Project logo

Ansible Hands on

Status GitHub Issues GitHub Pull Requests License


This repo for practicing Ansible playbooks

📝 Table of Contents

🧐 About

I am providing here few Ansible playbooks which will be used to configure Ubuntu EC2 machine and provision required pakcages and tools Also another part is to install/configure Nomad as a workload orchestrator Then having deployed erigon aks "Ethereum client"

🏁 Getting Started

Assumptions include:

-- Ubuntu 20.04 LTS -- EC2 instance as a host -- Attached Volume -- Ansible installed on the control machine

Project Structure and Ansible Playbooks & Example Outputs

Alt text

Mounted Volume Data

Alt text

Erigon Task resources

Alt text

Nomad All Services

Alt text

basic-utility this playbook will configre/install basic requirements
provision-node this playbook will install Docker and Nomda as a container orchestrator.
Manage-containers this playbook will create Nomad job which will deploy the "Ethereum client"

Installing

You can Simply run all playbook using the main.yml

ansible-playbook main.yml

Or you can specify some playbook to run

ansible-playbook playbooks/basic-utility.yml
ansible-playbook playbooks/provision-node.yml
ansible-playbook playbooks/manage-containers.yml

Also you can specify to run playbook with --tags option

You can add or skip tags from below list of tags as you want to run the playbook
  - Utils
  - Persistance
  - EBSVolumeMount
  - Hostname
  - Nomad
  - Docker
  - Erigon_nomad_job
For example , if you want to run only Utils , Nomad, Docker Tasks

 - ansible-playbook playbooks/basic-utility.yml --tags Utils
 - ansible-playbook playbooks/provision-node.yml --tags Nomad
 - ansible-playbook playbooks/provision-node.yml --tags Docker

.

🔧 Running nomad

To run nomad Job & Check nomad job status & logs

nomad run nomad-job.hcl
nomad job status JOBNAME
nomad alloc status ALLOCID

🎈 Steps

  • Install basic Utilities
  • Provision Machine
    • Mount Driver related tasks.
    • Update Host Name
    • Install & Configure Nomad
    • Enable Nomad Agent/Service on Systemd
    • Install Docker
  • Deploy Ethereum node as a container into Nomad with the following tasks
    • Configure Job
    • Configure erigon
    • Configure Prometheus
    • Configure Grafana
    • Mount Docker Volumes

🚀 Deployment

This project assumes the Node machines will be AWS EC2 Ubuntu 20.4 based, with attached EBS Volume Machine specs should be at least 4 GB RAM, 4 Core CPU

Deployment Easily managed with ansible and you can override vars.yml file for certain variables values.

Regarding Deploying on Non AWS EC2 or EC2 without attached EBS Volume , you need to skip EBSVolumeMount tasks, as below

You may need to first set the value of this variable

volume_path: /dev/nvme1n1

For Running on machine without Attached EBS Volume

ansible-playbook main.yml --skip-tags EBSVolumeMount

All Data should be saved in below paths

/erigonVolumeData/

⛏️ Built Using

✍️ Authors

🎉 Acknowledgements