Here is a concise, clear list of instructions describing what the project should do using Vagrant + VirtualBox + Ansible, without explaining DHCP/DNS logic.
-
Create a
Vagrantfilethat defines multiple virtual machines using VirtualBox as the provider.- Assign each machine a hostname.
- Configure private network interfaces with static IPs.
- Allocate resources (RAM/CPU) as needed.
- Ensure SSH access is available for Ansible.
-
Set up automatic provisioning in Vagrant so that each VM is configured using Ansible when it is created.
- Use
ansibleoransible_localas the provisioner. - Map each VM to the correct Ansible playbook.
- Use
-
Prepare an Ansible inventory file (
inventory.yml) that groups the machines according to their roles.- Define hostnames, IP addresses, and connection options.
- Organize machines logically (e.g., DNS server, DHCP server, clients).
-
Create Ansible playbooks that fully automate the configuration of each virtual machine.
- Install required packages using the appropriate modules.
- Deploy configuration files.
- Modify system settings through Ansible tasks.
- Manage and restart services as needed.
- Ensure every playbook is idempotent and repeatable.
-
Configure
ansible.cfgto define default settings for your automation.- Set the inventory path.
- Disable host key checking.
- Define interpreter and connection behaviors.
-
Add a script (
script.sh) if desired, to simplify running the entire environment with a single command. -
Run the environment using:
vagrant up
This should automatically:
- Create all virtual machines.
- Configure them using Ansible.
-
Shut down or remove the environment for cleanup:
vagrant halt vagrant destroy -f