# akssharma1994/ansible_playbooks architecture

> Architecture diagram of the GitHub repository akssharma1994/ansible_playbooks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akssharma1994/ansible_playbooks
- Repository: https://github.com/akssharma1994/ansible_playbooks

## Overview

##### Project type and purpose
- This is an infrastructure-as-code repository containing Ansible playbooks and shell scripts used to provision, configure, and maintain Linux services (Nginx, Tomcat, network services, FTP, etc.).
- Its purpose is to automate deployment and configuration of web and application servers, plus common network utilities, using Ansible and custom shell scripts.

##### File structure
- Top-level directories:
- ansible_nginx – Ansible playbook (main.yml) and Jinja2 template (index.html.j2) for Nginx
- ansible_nginxx – Variation of Nginx playbook (includes site.conf.j2, task.yml, sync.yml)
- ansible_tomcat – Ansible playbook (task.yml) for deploying/configuring Tomcat
- shell_scripting – Standalone shell scripts (dhcp.sh, ftp_server.sh, local_repo.sh, ping.sh, userinfo.sh)
- Each Ansible folder contains:
- Playbook(s) in YAML
- Jinja2 templates (for rendering configs)
- No complex application code or services beyond infra provisioning.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Control["Control Node"]:::ansible
    Inventory["Inventory (hosts file)"]:::ansible

    Control -->|"reads"| Inventory

    subgraph "Ansible Playbooks"
        nginx_pb["ansible_nginx/main.yml"]:::ansible
        nginx_tpl["index.html.j2"]:::template
        nginx_pb -->|"uses template"| nginx_tpl

        nginxx_pb["ansible_nginxx/task.yml"]:::ansible
        nginxx_sync["ansible_nginxx/sync.yml"]:::ansible
        nginxx_tpl["site.conf.j2"]:::template
        nginxx_static["index.html"]:::template
        nginxx_pb -->|"uses template"| nginxx_tpl
        nginxx_pb -->|"deploys static"| nginxx_static
        nginxx_pb -->|"calls sync"| nginxx_sync

        tomcat_pb["ansible_tomcat/task.yml"]:::ansible
    end

    Control -->|"executes"| nginx_pb
    Control -->|"executes"| nginxx_pb
    Control -->|"executes"| tomcat_pb

    subgraph "Shell Scripts"
        dhcp["dhcp.sh"]:::shell
        ftp["ftp_server.sh"]:::shell
        localrepo["local_repo.sh"]:::shell
        ping["ping.sh"]:::shell
        userinfo["userinfo.sh"]:::shell
    end

    Control -->|"runs"| dhcp
    Control -->|"runs"| ftp
    Control -->|"runs"| localrepo
    Control -->|"runs"| ping
    Control -->|"runs"| userinfo

    subgraph "Target Nodes"
        nginx_hosts["Nginx Hosts"]:::target
        tomcat_hosts["Tomcat Hosts"]:::target
        util_hosts["Network Utility Hosts"]:::target
    end

    nginx_pb -->|"provisions"| nginx_hosts
    nginxx_pb -->|"provisions"| nginx_hosts
    tomcat_pb -->|"provisions"| tomcat_hosts

    dhcp -->|"configures via SSH"| util_hosts
    ftp -->|"sets up via SSH"| util_hosts
    localrepo -->|"sets up via SSH"| util_hosts
    ping -->|"executes on"| util_hosts
    userinfo -->|"executes on"| util_hosts

    click nginx_pb "https://github.com/akssharma1994/ansible_playbooks/blob/main/ansible_nginx/main.yml"
    click nginx_tpl "https://github.com/akssharma1994/ansible_playbooks/blob/main/ansible_nginx/index.html.j2"
    click nginxx_pb "https://github.com/akssharma1994/ansible_playbooks/blob/main/ansible_nginxx/task.yml"
    click nginxx_sync "https://github.com/akssharma1994/ansible_playbooks/blob/main/ansible_nginxx/sync.yml"
    click nginxx_static "https://github.com/akssharma1994/ansible_playbooks/blob/main/ansible_nginxx/index.html"
    click nginxx_tpl "https://github.com/akssharma1994/ansible_playbooks/blob/main/ansible_nginxx/site.conf.j2"
    click tomcat_pb "https://github.com/akssharma1994/ansible_playbooks/blob/main/ansible_tomcat/task.yml"
    click dhcp "https://github.com/akssharma1994/ansible_playbooks/blob/main/shell_scripting/dhcp.sh"
    click ftp "https://github.com/akssharma1994/ansible_playbooks/blob/main/shell_scripting/ftp_server.sh"
    click localrepo "https://github.com/akssharma1994/ansible_playbooks/blob/main/shell_scripting/local_repo.sh"
    click ping "https://github.com/akssharma1994/ansible_playbooks/blob/main/shell_scripting/ping.sh"
    click userinfo "https://github.com/akssharma1994/ansible_playbooks/blob/main/shell_scripting/userinfo.sh"

    classDef ansible fill:#D0E6FF,stroke:#0366d6,stroke-width:1px;
    classDef template fill:#F0F0F0,stroke:#333,stroke-width:1px,shape:cylinder;
    classDef target fill:#E6FFEA,stroke:#028A0F,stroke-width:1px;
    classDef shell fill:#F5F5F5,stroke:#888,stroke-dasharray:5 5;
```
