Creates a FreeBSD server which provides a ready to run 'poudriere' installation. See FreeBSD Handbook for further information.
I wanted to have a build server which I don't have to keep running all the time. To accomplish this, the package repository and the build option for all the packages are synced to S3. This allows me to destroy the build server after the packages have been build and synced.
Before you start you may provide you own files for by setting the path for the corresponding Ansible variable.
make.conf
, (poudriere_build_options_file
)ports-list
, (poudriere_port_list_file
)poudriere.key
, (poudriere_key_file
)
You may do so by providing you own version of the file and setting the path to it via the corresponding Ansible variable.
With all that in mind the typical workflow looks like this.
- Spawn a new server (there is a Vagrant file for this)
- Apply this Ansible role
- Log in
- Run:
sudo build-ports
- Run:
sudo upload-to-s3
- Log out
- Destroy the server
Easy as pie.
This role is intent to be used with a fresh FreeBSD install with some minor modifications. There is a Vagrant Box with providers for VirtualBox and EC2 you may use. I created this Vagrant project to create VirtualBox and EC2 machines.
S3 region to use. Default: ''
.
S3 access key. Default: ''
.
S3 secret key. Default: ''
.
The bucket to use to store the packages and build options. Default: ''
.
The path within the S3 bucket where to put packages
and build-options
folder. Default: '/public/FreeBSD'
.
The FreeBSD mirror server used to set up the jails. Default: 'ftp://ftp.freebsd.org'
.
The path where the package signing key should be saved. Default: '/usr/local/etc/ssl'
.
The private key used to sign the packages. Please change this to use your own key. Default: 'poudriere.key.default'
.
The list of ports to build. Default: 'ports-list.default'
.
The ports branch name to checkout via svn and build. Default: 'head'
.
Build options make.conf
used to build to ports. Default: 'make.conf.default'
.
The jails which should be created.
poudriere_jails:
- { jail_name: 'freebsd-11_2_x64', version: '11.2-RELEASE' }
Default: ''
.
The name of the zpool that will be used by poudriere
. If the pool does not exist, it will be created using the devices specified in poudriere_zpool_devices
. Default: 'tank'.
The devices that should be used to create the zpool for poudriere, e.g. /dev/nvd1
. Default: ''.
None.
---
- hosts: default
sudo: true
vars:
aws_access_key_id: '{{ lookup("env","AWS_ACCESS_KEY_ID") }}'
aws_secret_access_key: '{{ lookup("env","AWS_SECRET_ACCESS_KEY") }}'
aws_default_region: '{{ lookup("env","AWS_DEFAULT_REGION") }}'
s3_bucket_name: 'repo.bucket.name'
poudriere_ports_list_file: './files/ports.list'
poudriere_key_file: './files/poudriere.key'
poudriere_build_options_file: './files/make.conf'
poudriere_jails:
- { jail_name: 'freebsd-11_2_x64', version: '11.2-RELEASE' }
roles:
- { role: JoergFiedler.freebsd-build-server }
BSD
If you like it or do have ideas to improve this project, please open an issue on Github. Thanks.