Vagrant + Ansible config for provisioning a virtual machine.
The idea is to do an automated provision a VM using ansible and vagrant, then use that VM as a base to create an ISO using a customized version of the sadly now quasi-defunct remastersys.
- Install the dependencies:
- Vagrant
- Virtualbox
- Ansible
- Clone this repo
- (optional) Modify
ansible/config.ymlto enable and disable modules (see below) by settingMODULE_NAME__enabled
- Please DO NOT commit changes to this file. You can prevent git from commiting your changes by running
git update-index --assume-unchanged config.yml(yes, we need to implement a better way to deal with this) - You can also use this file to override any other setting in
roles/*/vars/main.yml
- In the repo dir, run
vagrant up
- Note: This starts with a very basic Ubuntu VM and then installs a bunch of stuff e.g. Gnome, so expect the initial provisioning to take a long time!
- Do either of the following:
- Build ISO as part of provisioning:
- In the repo dir, edit
config.ymland setbuild_iso__enabled: true - Run
vagrant provision
- In the repo dir, edit
- Build ISO later:
- Mess around, experiment with the scripts, etc
- Run
vagrant provision - Repeat previous steps as necessary
- When you are ready to build the iso, connect to the VM with
vagrant ssh - On the VM, run
sudo /vagrant/data/build/remastersys/bin/remastersys backup
If all goes well, a new ISO image will be created in /vagrant/data/build (aka *repo_dir*/data/build on the host system).
A "module" is an ansible role that deploys a particular service or configuration
- Create a new ansible role directory in
ansible/roles/
- Be sure to make any variables defined in your role's
vars/directory follow the formatMODULE_NAME__VAR_NAME(note the two underscores in the middle) - Be sure to include a
MODULE_NAME__enabledvariable.
- Add a line to
ansible/main.yml, following the format used for other roles in that file.
- DO NOT make your role execute unconditionally. Always use a
__enabledvariable!