Dogrant

Vagrant Configuration CLI

This Python tool provides a command-line interface (CLI) for managing Vagrant environments and configurations. It supports defining and managing various Vagrant configuration parameters like VM name, memory, CPUs, synced folders, and forwarded ports, and includes the ability to generate Virtual Machines (VMs) deploying services through Docker Compose.

Table of Contents

  1. Prerequisites
  2. Installation
  3. Usage
  4. Commands
  5. Troubleshooting

Prerequisites

Ensure you have Vagrant and VirtualBox installed to manage VMs effectively.

Installation

Clone the repository:

git clone https://gitlab.cylab.be/cylab/dogrant.git

Create a virtual environment and activate it (optional):

python3 -m venv appenv
source appenv/bin/activate

Install the required dependencies:

python3 -m pip install -r requirements.txt

Ensure you have Vagrant and VirtualBox installed for managing VMs.

Usage

The application provides multiple commands to manage the Vagrant environment. It uses Typer to define the CLI interface.

To run the CLI, execute the following command:

python3 app.py

You can also run specific commands directly (e.g., for configuration or VM generation):

python3 app.py generate config

Commands

generate config

Define the configuration of your Vagrant environment with this command. Customize parameters:

Example:

python3 app.py generate config

generate vm

Generate and export a Vagrant VM with Docker Compose services deployed inside the generated folder. The output includes an .ova file and an SSH private_key for secure access.

Example:

python3 app.py generate vm

Access the deployed VM:

ssh -i generated/private_key vagrant@<host-ip>

clean config

Remove the Vagrantfile to reset your configuration.

Example:

python3 app.py clean config

clean vm

Clean up the exported VM files from the generated folder.

Example:

python3 app.py clean vm

Troubleshooting

Known Issues and Solutions

This website uses cookies. More information about the use of cookies is available in the cookies policy.
Accept