This repository contains everything needed to build a customized mfsBSD image that can be used to provision FreeBSD servers with Foreman.
Also check out unattended upgrades for FreeBSD.
In order to deploy FreeBSD servers with Foreman, the following requirements must be met:
- Provisioning templates for FreeBSD are already included in Foreman
- A custom mfsBSD image, can be build manually (see below) or downloaded from here
- A working PXE/DHCP/TFTP boot environment (Foreman Smart Proxy)
- Server or VM needs at least 1 GB of RAM to store the image during installation
- Create a "installation media" entry in Foreman for FreeBSD (use local or official mirror, e.g.
http://ftp.freebsd.org/pub/FreeBSD/releases/$arch/$major.$minor-RELEASE/) - Create a new "operating system" entry in Foreman for the desired FreeBSD release
- Copy the custom mfsBSD image to your TFTP server
- Create a new host in Foreman, watch the FreeBSD installation begin :)
Use build.sh to create your own images or to include a modified version of rc.local. The script must be run as root (on a FreeBSD server).
# git clone https://github.com/fraenki/freebsd-foreman.git
# cd freebsd-foreman
# ./build.sh -r 14.2
To use a local copy of the mfsbsd image instead of having the script download it, just specify the filename:
./build.sh -r 14.3 -f downloads/mfsbsd-14.3-RELEASE-p3-amd64.img
If no mfsBSD image is available for download, the script can try to automatically build it for the specified FreeBSD release:
./build.sh -r 14.3 -b
Please note that building mfsBSD requires more diskspace and will automatically install all required dependencies. Refer to mfsBSD build instructions for further information.
Cleanup build/tmp directories:
./build.sh -c
Thanks to Martin Matuška for creating mfsBSD and his talk on Deploying FreeBSD systems with Foreman.