# dinhocamp/automation architecture

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

- Interactive diagram: https://gitdiagram.com/dinhocamp/automation
- Repository: https://github.com/dinhocamp/automation

## Overview

##### Project's Main Components
- Deployment Orchestrator and Automation Engine:
– This is primarily driven by Ansible (see files like ansible.cfg, ansible_installation.sh, ansible_modules.yml, and various *.yml playbooks).
– It is responsible for executing automation tasks such as VM creation (create_vm.sh, launch_vm.yml), configuration management (passwd.yml, ip_config.yml), and SSH connection management (ESXI_ssh_config.sh, ssh_config.yml, ssh.sh).
- Virtualization and Provisioning Modules:
– There are scripts specific for interacting with ESXi (e.g., check_ESXi_resources.sh, esxi_verif.sh) as well as for OpenStack (check_openstack_installation.yml, extract_openstack_conf.sh).
– The “test-openstack” directory contains playbooks and tests (create_openStack_vm.yml, create_tenant.yml, deploy.yml, test.sh) suggesting a dedicated module for OpenStack deployments.
- Custom ISO Installer Component:
– The “custom_iso_installers” directory contains files (config.cfg, grub.cfg, user-data, etc.) needed to generate or modify ISO images – a key part of provisioning.
– Additional preparatory scripts (prepare_iso_desktop.sh, prepare_iso_server.sh, prepare_iso_files.sh) hint toward specialized roles for building custom installer images.
- Utility and Verification Scripts:
– Scripts like ip_check.sh, check_openstack_installation.yml, and ssh_key_verification.yml serve as checks or supportive utilities.
– “dump.txt”, “result.txt”, “error.txt” indicate logging or result capturing.

##### Establish Component Relationships and Interactions
- The automation engine (Ansible-based) functions as the central controller that triggers various playbooks and scripts.
- It interfaces with both the ESXi and OpenStack environments:
– Through respective verification scripts and configuration files, it checks for availability, resources, and connectivity.
- Custom ISO installers feed into the provisioning process, creating images that are then deployed via the automation engine.
- Utility scripts and configuration files support and validate the connections (e.g., SSH configuration, IP checking) ensuring that the resources are in sync before and after deployment.

##### Incorporate Architectural Patterns and Design Principles
- Separation of concerns is evident: each component (deployment, testing, custom ISO creation, resource checking) is organized within its own file or folder, suggesting a modular approach.
- The usage of Ansible implies a declarative configuration pattern.
- Integration of testing (under test-openstack) demonstrates a commitment to ensuring reproducibility and reliability throughout automated deployments.

##### Notable Technologies and Frameworks
- Ansible: for task orchestration and configuration management.
- Shell Scripting: for direct system operations and utility tasks.
- Virtualization Technologies: ESXi and OpenStack are the target environments.
- ISO Customization: Tools/scripts to build customized boot/install images.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Control Plane: Automation Engine"
        A1["ansible.cfg"]:::automation
        A2["ansible_installation.sh"]:::automation
        A3["ansible_modules.yml"]:::automation
        A4["create_vm.sh"]:::automation
        A5["launch_vm.yml"]:::automation
        A6["passwd.yml"]:::automation
        A7["ip_config.yml"]:::automation
        A8["ssh.sh"]:::automation
        A9["ssh_config.yml"]:::automation
    end

    subgraph "ESXi Resource Manager"
        E1["ESXI_ssh_config.sh"]:::esxi
        E2["check_ESXi_resources.sh"]:::esxi
        E3["esxi_verif.sh"]:::esxi
    end

    subgraph "OpenStack Deployment Manager"
        O1["check_openstack_installation.yml"]:::openstack
        O2["extract_openstack_conf.sh"]:::openstack
        O3["devstack_installation.yml"]:::openstack
        subgraph "Test-OpenStack Suite"
            O4["create_openStack_vm.yml"]:::openstack
            O5["create_tenant.yml"]:::openstack
            O6["deploy.yml"]:::openstack
            O7["test.sh"]:::openstack
        end
    end

    subgraph "Custom ISO Build Module"
        I1["custom_iso_installers Directory"]:::iso
        I2["prepare_iso_desktop.sh"]:::iso
        I3["prepare_iso_server.sh"]:::iso
        I4["prepare_iso_files.sh"]:::iso
        I5["config.cfg (root)"]:::iso
    end

    subgraph "Utility & Verification Suite"
        U1["ip_check.sh"]:::utility
        U2["ssh_key_verification.yml"]:::utility
        U3["dump.txt"]:::utility
        U4["result.txt"]:::utility
        U5["error.txt"]:::utility
        U6["copy_script.yml"]:::utility
        U7["collect_vm_info.yml"]:::utility
        U8["get_vms.yml"]:::utility
        U9["scp_Vars.yml"]:::utility
    end

    I1 -->|"feeds"| A1
    A1 -->|"deploys-to"| E1
    A1 -->|"deploys-to"| O1
    U1 <-->|"verification"| A1

    click A1 "https://github.com/dinhocamp/automation/blob/main/ansible.cfg"
    click A2 "https://github.com/dinhocamp/automation/blob/main/ansible_installation.sh"
    click A3 "https://github.com/dinhocamp/automation/blob/main/ansible_modules.yml"
    click A4 "https://github.com/dinhocamp/automation/blob/main/create_vm.sh"
    click A5 "https://github.com/dinhocamp/automation/blob/main/launch_vm.yml"
    click A6 "https://github.com/dinhocamp/automation/blob/main/passwd.yml"
    click A7 "https://github.com/dinhocamp/automation/blob/main/ip_config.yml"
    click A8 "https://github.com/dinhocamp/automation/blob/main/ssh.sh"
    click A9 "https://github.com/dinhocamp/automation/blob/main/ssh_config.yml"

    click E1 "https://github.com/dinhocamp/automation/blob/main/ESXI_ssh_config.sh"
    click E2 "https://github.com/dinhocamp/automation/blob/main/check_ESXi_resources.sh"
    click E3 "https://github.com/dinhocamp/automation/blob/main/esxi_verif.sh"

    click O1 "https://github.com/dinhocamp/automation/blob/main/check_openstack_installation.yml"
    click O2 "https://github.com/dinhocamp/automation/blob/main/extract_openstack_conf.sh"
    click O3 "https://github.com/dinhocamp/automation/blob/main/devstack_installation.yml"
    click O4 "https://github.com/dinhocamp/automation/blob/main/test-openstack/create_openStack_vm.yml"
    click O5 "https://github.com/dinhocamp/automation/blob/main/test-openstack/create_tenant.yml"
    click O6 "https://github.com/dinhocamp/automation/blob/main/test-openstack/deploy.yml"
    click O7 "https://github.com/dinhocamp/automation/blob/main/test-openstack/test.sh"

    click I1 "https://github.com/dinhocamp/automation/tree/main/custom_iso_installers/"
    click I2 "https://github.com/dinhocamp/automation/blob/main/prepare_iso_desktop.sh"
    click I3 "https://github.com/dinhocamp/automation/blob/main/prepare_iso_server.sh"
    click I4 "https://github.com/dinhocamp/automation/blob/main/prepare_iso_files.sh"
    click I5 "https://github.com/dinhocamp/automation/blob/main/config.cfg"

    click U1 "https://github.com/dinhocamp/automation/blob/main/ip_check.sh"
    click U2 "https://github.com/dinhocamp/automation/blob/main/ssh_key_verification.yml"
    click U3 "https://github.com/dinhocamp/automation/blob/main/dump.txt"
    click U4 "https://github.com/dinhocamp/automation/blob/main/result.txt"
    click U5 "https://github.com/dinhocamp/automation/blob/main/error.txt"
    click U6 "https://github.com/dinhocamp/automation/blob/main/copy_script.yml"
    click U7 "https://github.com/dinhocamp/automation/blob/main/collect_vm_info.yml"
    click U8 "https://github.com/dinhocamp/automation/blob/main/get_vms.yml"
    click U9 "https://github.com/dinhocamp/automation/blob/main/scp_Vars.yml"

    classDef automation fill:#ccf,stroke:#333,stroke-width:2px;
    classDef esxi fill:#cfc,stroke:#333,stroke-width:2px;
    classDef openstack fill:#fc9,stroke:#333,stroke-width:2px;
    classDef iso fill:#f9c,stroke:#333,stroke-width:2px;
    classDef utility fill:#cff,stroke:#333,stroke-width:2px;
```
