项目作者: stoned

项目描述 :
Packer templates for Vagrant NetBSD boxes
高级语言: Shell
项目地址: git://github.com/stoned/packer-nbsd-boxes.git
创建时间: 2014-10-13T21:08:27Z
项目社区:https://github.com/stoned/packer-nbsd-boxes

开源协议:

下载


packer-nbsd-boxes

Packer-nbsd-boxes helps to build NetBSD Vagrant
boxes with the help of templates for Packer.

It is inspired by Opscode’s Bento.

At this time the provided Packer templates only support virtualbox,
both as a builder and as a post-processor provider.

How to build the boxes

Install Packer then from the top-level of this
project, validate and build a Packer template.

Example with the netbsd-6-amd64.json template.

  • Check that the template is valid:

    1. $ packer validate netbsd-6-amd64.json
    2. Template validated successfully.
    3. $
  • Build the box image from the template:

    1. $ packer build netbsd-6-amd64.json
    2. ...
    3. ==> Builds finished. The artifacts of successful builds are:
    4. --> virtualbox-iso: VM files in directory: packer-netbsd-6.1.5-amd64-virtualbox
    5. --> virtualbox-iso: 'virtualbox' provider box: ./builds/netbsd-6.1.5-amd64-virtualbox.box
    6. $
  • The box image is available in the builds/ subdirectory.

Available boxes

  • netbsd-8-amd64.json : Packer template for NetBSD 8.1 amd64
  • netbsd-7-amd64.json : Packer template for NetBSD 7.1.2 amd64
  • netbsd-6-amd64.json : Packer template for NetBSD 6.1.5 amd64

Boxes without provisioners

By default the boxes have both Chef and Puppet installed,
from pkgsrc but they can be build
without any provisioner with a command like the following:

  1. $ packer build -var provisioner="" -var build_suffix=-provisionerless netbsd-6-amd64.json
  2. ...
  3. ==> Builds finished. The artifacts of successful builds are:
  4. --> virtualbox-iso: VM files in directory: packer-netbsd-6.1.5-amd64-provisionerless-virtualbox
  5. --> virtualbox-iso: 'virtualbox' provider box: ./builds/netbsd-6.1.5-amd64-provisionerless-virtualbox.box
  6. $

Defining the Packer variable build_suffix is not required
but can be useful to name Packer’s artifacts.

Synced folders

VirtualBox shared folders are not supported as VirtualBox Guest
Additions are not available for NetBSD.

But Vagrant NFS synced folders are available.

It should be noted that a private (“host-only”) network between the
virtualbox guest and the host must be setup to use NFS synced
folders. The guest must also use a static IP address in this
network, specified in the Vagrantfile.

This is required for Vagrant before version 1.4. This limitation
was removed in Vagrant 1.4 but as VirtualBox Guest Additions are
not available for NetBSD, Vagrant cannot find out the guest’s address
in this network. So a static IP address in the private network is
required, no matter the version of Vagrant used.

Usage

Add something like the following to your Vagrantfile:

  1. Vagrant.configure("2") do |config|
  2. # Only NFS synced folder are supported.
  3. # And note that a private network with static IP is required
  4. config.vm.network :private_network, ip: "192.168.33.10"
  5. config.vm.synced_folder "/some/host/pathname", "/vagrant", type: "nfs"
  6. end

ISO files

When needed Packer downloads NetBSD installation ISO image files.
If you already have them available you can put them, or symlink
them, into a subdirectory named iso/.

-stoned