Skip to content

KasraFallahi/g2-iaas-ansible

 
 

Repository files navigation

G2 Ansible IaC (Infrastructure as code)

Idempotent playbooks

Ansible doc

Roles

  • Essentials
  • Swap
  • Docker (latest)
  • Traefik (traefik:2.9)
  • MySQL (mysql:8.0-debian)
  • Redis (redis:7.0-bullseye)
  • Node exporter (latest)
  • Gitlab runner (latest)
  • Reboot

Setup

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Run

Add ssh config host name to hosts

ansible-playbook setup.yml

ansible localhost -m ping
ansible all -i ./hosts -m ping

Vault

ansible-vault encrypt_string --name 'password_name'

Must changes

Swap: 2G
Traefik: auth
MySQL: auth
Redis: auth

TODOs

  • Limit containers ram & cpu
  • Disaster recovery plan
  • Docker compose v2

Testing

docker -H ssh://ansib exec -it mysql mysql -u <username> -p <database>
docker -H ssh://ansib exec -it redis redis-cli -p 6379 -a 'password' ping

About

G2Tech IaaS Ansible Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%