3ofcoins / jetpack

**PROTOTYPE** FreeBSD Jail/ZFS based implementation of the Application Container Specification
Other
529 stars 38 forks source link

Add Vagrantfile for easy testing and provisioning #1

Closed lenada closed 9 years ago

lenada commented 9 years ago

I added a vagrant configuration & ansible provisioning. Can be tested with $ vagrant up

Please provide some feedback wether some of the following things would make sense

Provision / run integration tests
mpasternacki commented 9 years ago

Thanks for the contribution! Vagrantfile will certainly make it easier to try Jetpack out and to run tests. A couple remarks:

Please rename the provision/ directory to contrib/vagrant/. I expect there will be more helper scripts in the future (at least a port Makefile to build a package, at least until Jetpack makes it into /usr/ports), and I'd like to avoid too many directories in the repository root. If the Ansible configuration is intended to be a general one rather than tied to the Vagrantfile, contrib/ansible/ may be a better name.

Shell nitpick: in provision/bootstrap_freebsd.sh you could use set -e at the beginning (fail whole script on non-zero exit code from command) rather than &&ing the whole thing.

mpasternacki commented 9 years ago

Just checked: if you add interface and modules to /etc/rc.conf, you can run service netif start lo1 and service kld start to configure it without a restart.

lenada commented 9 years ago

move to contrib

done

I'm not sure hardcoding IP in config.vm.private_network is a good approach

to get the NFS mount from the host os into the guest os working I found no other way then specifiying config.vm.private_network. 10.0.1.10 gets assigned to em1, em0 is assigned "dynamically"

I'm not convinced that Ansible is needed (especially that installing Ansible needs a shell provisioning script anyway

I managed to get rid of the shell provisioning to pre-bootstrap ansible. the Python symlink is now also obsolete.

The big advantage of ansible - it is very easy to provision tasks in an idempotent fashion. I have restructured and split up the tasks for better readability and later reuse for other environments then the vagrant box.

Besides immediate ifconfig and kldload

went from the one-off approach to proper rc.conf

Debootstrap is not required

removed

mpasternacki commented 9 years ago

Other than adding Ansible requirement to README, this is good to go.

mpasternacki commented 9 years ago

Thank you!