Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

somaz94/vagrant-packer

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant & Packer Collection

LicenseLatest Tag

A collection of infrastructure-as-code configurations for building machine images with Packer and managing virtual machines with Vagrant.


Features

  • Packer Templates: HCL2 and JSON templates for building VM images
  • Multi-Platform: CentOS 7, Rocky Linux 8.6, Ubuntu 20.04 (GCE), Amazon Linux 2 (AWS)
  • Multi-Provider: KVM/QEMU (local), GCP, AWS
  • Vagrant Configs: Multi-node cluster provisioning with libvirt
  • Automated Setup: Kickstart files for unattended OS installation
  • Security Hardening: PAM, SSH, account lockout, login banners, command logging
  • VM Lifecycle: Shell scripts for managing VM snapshots, start/stop, rebuild

Project Structure

vagrant-packer/
├── packer/
│   ├── hcl2/                    # Modern Packer HCL2 templates
│   │   ├── centos/              # CentOS 7 (QEMU/KVM)
│   │   ├── rocky/               # Rocky Linux 8.6 (QEMU/KVM)
│   │   ├── ubuntu-gce/          # Ubuntu 20.04 (GCP)
│   │   └── amazon-linux/        # Amazon Linux 2 (AWS)
│   └── json/                    # Legacy JSON templates (deprecated)
│       ├── centos/
│       ├── rocky/
│       ├── ubuntu-gce/
│       └── amazon-linux/
├── vagrant/
│   ├── shared/                  # Common init functions & network config
│   ├── somaz-v1/                # Full cluster (11 nodes)
│   ├── somaz-v2/                # Compact cluster (6 nodes)
│   └── somaz-v3/                # Minimal cluster (4 nodes)
├── docs/                        # Detailed guides
├── .github/workflows/           # GitHub Actions
├── cliff.toml                   # git-cliff changelog config
└── LICENSE

Quick Start

Build a VM Image with Packer

cd packer/hcl2/rocky
cp rocky.auto.pkrvars.hcl.example rocky.auto.pkrvars.hcl
# Edit rocky.auto.pkrvars.hcl with your values
packer init .
packer build rocky.json.pkr.hcl

Start a Vagrant Cluster

cd vagrant/somaz-v3
vagrant up

Manage VM Lifecycle

./somazenv.sh status    # Show all VM status
./somazenv.sh start     # Start or create VMs
./somazenv.sh stop      # Graceful halt
./somazenv.sh rebuild   # Destroy and recreate all VMs

Documentation

Guide Description
Installation Guide Prerequisites, Vagrant/Packer/KVM setup, cloud provider config
Packer Guide Build VM images for QEMU, GCE, AWS with variables and kickstart
Vagrant Guide Multi-node cluster configs, networking, provisioning, resources

Reference


Contributing

Issues and pull requests are welcome.


License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This is Vagrant and Packer Collection

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.