Skip to content

tgrants/dev-vm-ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dev-vm-ansible

Automated development virtual machine setup for students using Ansible.

Features

  • Lightweight - Runs smoothly on modest hardware (tested with 2 GiB RAM)
  • Compact - Initial VirtualBox disk size: ~4 GiB (~1 GiB when compressed)
  • Preconfigured tools - comes with development software and setup scripts
  • 🟡 Custom xfce theme (planned)
  • 🟡 Telemetry (opt-out, planned)

Tools

  • PHP and Composer
  • Sqlite3
  • VSCode and Git

Install scripts

  • Node.js and npm
  • MariaDB
  • Github cli

Instructions

Virtualbox

Create the virtual machine

  • Install Debian on a Virtualbox VM
    • Create users (or update hosts)
      • Set root password to pass
      • Create user with password pass
    • Software selection - select only SSH server
  • Prepare the VM for ansible
    • Update VM network settings in VirtualBox Settings > Network > Attached to > Bridged Adapter
    • Log in as root su -
    • Restart network service systemctl restart networking
    • Get the ip address with ip a and update the hosts in this repository
    • Install sudo and python for Ansible apt install sudo python3
    • Add user to sudoers adduser user sudo
    • Copy key by SSH-ing into the VM ssh [email protected]
  • Setup the VM ansible-playbook playbooks/setup.yml

Trim virtual disk

  • Remove all unnecessary files ansible-playbook playbooks/cleanup.yml
  • On VM, run clear-disk, then shut it down
  • On host, run vboxmanage modifymedium /mnt/storage/VBOX/phpdev/phpdev.vdi --compact
    • Edit this path to match your .vdi file

Updates

It is recommended to run new versions of these playbooks on a fresh Debian install. However, in most cases, re-running them should work without issues.

For details on changes, check the Releases page on GitHub.

Contributing

Before submitting a pull request, please discuss your proposed changes in an issue first. Major changes are generally not accepted, as this project is customized for my requirements. For such changes it is recommended to create your own fork of this project. However, feel free to open an issue if you encounter a problem or have any questions.

License

Note

Versions below v4 are licensed under the terms of the Unlicense.

This project is licensed under the terms of the MIT license. See the LICENSE file for more information.