This repo for practicing Ansible playbooks
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"
Assumptions include:
-- Ubuntu 20.04 LTS -- EC2 instance as a host -- Attached Volume -- Ansible installed on the control machine
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"
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
.
nomad run nomad-job.hcl
nomad job status JOBNAME
nomad alloc status ALLOCID
- 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
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/
- @DEV.MOHAMMED.OTHMAN - Design & Implementation work
- Inspiration
- References
-
https://github.com/ledgerwatch/erigon/blob/stable/docker-compose.yml
-
https://docs.ansible.com/ansible/latest/collections/community/general/nomad_job_module.html#examples
-
https://www.shubhamdipt.com/blog/how-to-create-a-systemd-service-in-linux/
-
https://learn.hashicorp.com/tutorials/nomad/get-started-ui?in=nomad/get-started
-
https://learn.hashicorp.com/tutorials/nomad/jobs-configuring?in=nomad/manage-jobs
-
https://prometheus.io/docs/prometheus/latest/getting_started/
-
https://community.grafana.com/t/new-docker-install-with-persistent-storage-permission-problem/10896
-