- If the
packer-vmm
package is prior to 1.7.3git clone https://github.com/double-p/packer-builder-openbsd-vmm
cd packer-builder-openbsd-vmm
make install
- Once the the port is updated, you can
rm ~/.packer.d/plugins/packer-builder-openbsd-vmm
(ormake uninstall
which does about the same thing).
- Run
ansible-playbook packer.yml -CD
to ensure the are will be acceptable then runansible-playbook packer.yml -D
to make the changes. There are a few variables to customize the built image.- hostname: (default
openbsd
) Hostname for the image. root_password
: (default*************
) Password for root (plaintext or encrypted). As this will be used with autoinstall(8), 13*
disables password logins.username
: (default username of the user running ansible) Username of the user to setup during install. Blank to disable.user_password
: (default*************
) Password for the user (plaintext or encrypted). As this will be used with autoinstall(8), 13*
disables password logins.user_pubkey
: (default: contents of~/.ssh/ed_25519.pub
) The public key for the user.timezone
: (default:UTC
) Timezone for the image.
- hostname: (default
- Allow the VM to talk to the host. Since the interface is created on VM start and destroyed after stop, add
pass quick on tap
to pf.conf and reload as you can't skip on the specific interface. - Setup an account.json credentials file.
- Create a service account
- Grant at least the following permissions (if you want to grant just these permissions, you'll need to create a custom role).
- compute.globalOperations.get
- compute.images.create
- storage.objects.create
- storage.objects.delete
- storage.objects.get
- Under actions, Manage keys and Create a new key.
- Save it as account.json.
- Create var file defining
project_id
andbucket
.project_id = "example" bucket = "example"
- Run
packer init openbsd.pkr.hcl
. - Run
packer build -var-file openbsd.pkrvars.hcl openbsd.pkr.hcl
. - Put your system back to normal.
- Remove packer and packer-vmm (possibly with
make uninstall
as mentioned in step 1). - Remove /etc/hostname.veb0, /etc/hostname.vport0, and /etc/vm.conf (or set those back to their prior state).
- Reset pf.conf to its prior state.
- Disable vmd.
- Remove the GCP service account.
- Remove packer and packer-vmm (possibly with