Skip to content

๐ŸŽฏ Ansible Server Foundation - Zero to DevOps hero! This project makes initial server setup effortless with pre-configured roles and best practices.

License

Notifications You must be signed in to change notification settings

younesmod/ansible-devops-foundation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Farsi MIT Ansible

๐Ÿš€ Ansible DevOps Server Setup

Debian Arch-Linux FreeBSD OpenBSD RedHat CentOS Suse Ubuntu

Ansible project for rapid and automated DevOps server provisioning.

Table Of Content

๐ŸŽฏ Project Overview

This project is a collection of Ansible Playbooks for automated and standardized Linux server setup in DevOps environments. Using this project, you can prepare your servers for service in minimal time.

  • Prepating-Server: Doing update and upgrade from apt Package Manager
  • Docker: Installing Docker and its utilities from apt Package Manager - Add user to Docker user group - Start and enable Docker service
  • Adding Soon ...

๐Ÿš€ Quick Start

  1. Clone the Repository
git clone https://github.com/younesmod/ansible-devops-foundation.git
cd ansible-devops-foundation
  1. Configure Servers
# Copy configuration file
cp vars/server_vars.example.yaml vars/server_vars.yaml

# Edit settings
nano vars/server_vars.yaml
  1. Run Playbooks
# Run all playbooks
ansible-playbook -i inventory/host.yaml -e @vars/server_vars.yaml playbook/*

# Or run individually
ansible-playbook -i inventory/host.yaml -e @vars/server_vars.yaml playbook/docker.yml

๐ŸŽฎ Usage

  • Full Setup:
ansible-playbook -i inventory/host.yaml -e @vars/server_vars.yaml playbook/*
  • Step-by-Step Execution:
# 1. Docker Installation
ansible-playbook -i inventory/host.yaml -e @vars/server_vars.yaml playbook/docker.yaml

# 2. Security Hardening
ansible-playbook -i inventory/host.yaml -e @vars/server_vars.yaml playbook/preparing.yaml

# 3. Security Hardening
ansible-playbook -i inventory/host.yaml -e @vars/server_vars.yaml playbook/hardening.yaml

# 4. Monitoring Setup (in-progress)
ansible-playbook -i inventory/host.yaml -e @vars/server_vars.yaml playbook/monitoring.yaml

๐Ÿ“ Project Structure

ansible-devops-foundation/
โ”œโ”€โ”€ inventory/
โ”‚   โ””โ”€โ”€ host.yaml                # Inventory file
โ”œโ”€โ”€ playbook/
โ”‚   โ”œโ”€โ”€ preparing.yaml           # Preparing setup
โ”‚   โ”œโ”€โ”€ hardening.yaml           # Security hardening
โ”‚   โ”œโ”€โ”€ harden-ssh.yaml          # SSH hardening
โ”‚   โ”œโ”€โ”€ harden-os.yaml           # OS hardening
โ”‚   โ”œโ”€โ”€ docker.yaml              # Docker installation
โ”‚   โ”œโ”€โ”€ nginx.yaml               # Nginx setup + Nginx Hardening 
โ”‚   โ”œโ”€โ”€ nginx-hardening.yaml     # Nginx Hardening
โ”‚   โ”œโ”€โ”€ nginx-setup.yaml         # Nginx setup
โ”‚   โ”œโ”€โ”€ php-setup.yaml           # Php setup
โ”‚   โ””โ”€โ”€ setup-node.yaml          # Preparing + Docker
โ”œโ”€โ”€ vars/
โ”‚   โ””โ”€โ”€ server_vars.yaml         # Main variables
โ”œโ”€โ”€ roles/                       # Ansible roles
โ”‚   โ”œโ”€โ”€ docker/                  # Docker role
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ preparing-server/        # Preparing role
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ nginx/                   # Nginx role
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ php/                     # Php role
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ os-hardening/            # OS-Hardening role
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ ssh-hardening/           # SSH-Hardening role
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ””โ”€โ”€ nginx-hardening/         # Nginx-Hardening role
โ”‚       โ””โ”€โ”€ ...
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ ansible.cfg                  # Ansible config
โ”œโ”€โ”€ LICENSE                      # License file
โ”œโ”€โ”€ README.fa.md
โ””โ”€โ”€ README.md

๐Ÿ“ Notes

  • Preparing-Server
    • FreeBSD and OpenBSD needs python on target OS.
    • Arch Linux may need some extra tweaks.
    • For SUSE needs to activate some of repositories.
    • Packages are optimized for each distros.
  • Docker
    • OpenBSD DOESN'T support docker natively.
    • FreeBSD does support docker but there are some limitations.
    • RedHat/CentOS 8+ uses dnf package manager instead of yum.
    • It's better to use official repository for production areas.
    • โ€ŒBe sure that the $user is existed on OS.

๐Ÿ‘ฅ Sources

About

๐ŸŽฏ Ansible Server Foundation - Zero to DevOps hero! This project makes initial server setup effortless with pre-configured roles and best practices.

Topics

Resources

License

Stars

Watchers

Forks