Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >= 7.0.0 < 9.0.0
Start using this module
Add this module to your Puppetfile:
mod 'puppet-poudriere', '3.1.0'
Learn more about managing modules with a PuppetfileDocumentation
Puppet-poudriere
Manage the FreeBSD PkgNG build system with Puppet.
Simple Implementation
poudriere::env { "90amd64":
makeopts => [
"WITH_PKGNG=yes",
"OPTIONS_SET+= SASL",
"OPTIONS_SET+= TLS",
"WITH_IPV6=TRUE",
"WITH_SSL=YES",
]
}
nginx::vhost { "build.${domain}":
port => 80,
vhostroot => '/usr/local/poudriere/data/packages',
autoindex => true,
}
@@pkgng::repo { "${::fqdn}-90amd64":
release => '9.0-RELEASE',
mirror_type => 'http',
repopath => '/90amd64-default/Latest/',
}
Changing default settings
The poudriere
class has some default parameters for global settings, such as the ZFS pool, root filesystem, and the FreeBSD mirror site to use (see init.pp
for details). To change these defaults, declare the poudriere
class with your own parameters.
If you do not want to use ZFS, you can use:
class { 'poudriere':
zpool => false,
}
Using port-specific make options
You can pass port-specific make options as a hash in pkg_makeopts
. For instance, if you want to build Apache 2.4 with the PHP 5.5 module, you can do the following:
poudriere::env { "90amd64":
makeopts => [
'WITH_PKGNG=yes',
'APACHE_VERSION=24',
'APACHE_PORT=www/apache24',
],
pkgs => [
'www/apache24',
'lang/php55',
],
pkg_makeopts => {
'lang/php55' => ['OPTIONS_SET+=APACHE'],
},
}
Alternatively, a file containing make options for both global and port-specific use could be defined by setting makefile
.
Using port-specific build options
Ports often allow for enabling or disabling support for certain features. Such options can be manually set by issueing poudriere options cat/port
but can also be defined in puppet by setting pkg_optsdir
. This should point to a directory with files such as could be found in /usr/local/etc/poudriere.d/${jail}-options/
:
poudriere::env { "90amd64":
pkg_optsdir => 'puppet:///path/to/dir/',
}
Managing seperate portstrees
The default
portstreee is no longer configuered by this module. You should create this yourself like so:
poudriere::portstree { 'default': }
poudriere::portstrees:
default:
By default environments use a portstree named default
, which you should create as per the instructions above; however each build environment can be told which portstree to use:
poudriere::portstree { "custom-ports":
cron_enable => false,
fetch_method => 'portsnap',
}
poudriere::env { "custom-build":
portstree => 'custom-ports',
}
poudriere::portstrees:
default:
custom-ports:
cron_enabled: false
fetch_method: portsnap
poudriere::environments:
custom-build:
portstree: custom-ports
Reference
Table of Contents
Classes
poudriere
: Poudriere is a tool that lets you build PkgNG packages from ports. This is cool because it gives you the flexibility of custom port optionspoudriere::xbuild
: Install cross-building dependencies
Defined types
poudriere::env
: This resource creates a build environment for a given release and architecture of FreeBSD. Passing in custom options gives you the ability topoudriere::portstree
: This resource creates a ports tree. You can have multiple ports trees for different building purposes. Automatic periodic updating of package
Data types
Poudriere::Architecture
: The architecture to target when building packagesPoudriere::Cron_interval
: Parameters to configure Poudriere's cron resourcesPoudriere::Fetch_method
: A supported fetch method for poudrierePoudriere::Tmpfs
: A supported tmpfs setting for poudriere
Classes
poudriere
Poudriere is a tool that lets you build PkgNG packages from ports. This is cool because it gives you the flexibility of custom port options with all the awesomeness of packages. The below class prepares the build environment. For the configuration of the build environment, see Class[poudriere::env].
Parameters
The following parameters are available in the poudriere
class:
zpool
zrootfs
freebsd_host
resolv_conf
poudriere_base
poudriere_data
use_portlint
mfssize
tmpfs
tmpfs_limit
tmpfs_blacklist
tmpfs_blacklist_tmpdir
max_memory
max_memory_per_package
max_files
distfiles_cache
git_baseurl
git_portsurl
svn_host
check_changed_options
check_changed_deps
bad_pkgname_deps_are_fatal
pkg_repo_signing_key
signing_command
pkg_repo_from_host
ccache_enable
ccache_dir
ccache_static_prefix
restrict_networking
allow_networking_packages
disallow_networking
allow_make_jobs_packages
parallel_jobs
prepare_parallel_jobs
save_wrkdir
wrkdir_archive_format
nolinux
no_force_package
no_package_building
http_proxy
ftp_proxy
no_restricted
allow_make_jobs
allow_make_jobs_packages
timestamp_logs
max_execution_time
nohang_time
atomic_package_repository
commit_packages_on_failure
keep_old_packages
keep_old_packages_count
porttesting_fatal
builder_hostname
preserve_timestamp
build_as_non_root
portbuild_user
portbuild_group
portbuild_uid
portbuild_gid
priority_boost
buildname_format
duration_format
use_colors
trim_orphaned_build_deps
delete_unknown_files
delete_unqueued_packages
local_mtree_excludes
url_base
html_type
html_track_remaining
determine_build_failure_reason
makeworldargs
package_fetch_branch
package_fetch_url
package_fetch_blacklist
package_fetch_whitelist
environments
portstrees
xbuild_package
zpool
Data type: Optional[String[1]]
The pool where poudriere will create all the filesystems
Default value: undef
zrootfs
Data type: Stdlib::Absolutepath
The root of the poudriere zfs filesystem
Default value: '/poudriere'
freebsd_host
Data type: String[1]
The host where to download sets for the jails setup
Default value: 'http://ftp.freebsd.org/'
resolv_conf
Data type: Stdlib::Absolutepath
A file on your hosts system that will be copied has /etc/resolv.conf for the jail
Default value: '/etc/resolv.conf'
poudriere_base
Data type: Stdlib::Absolutepath
The directory where poudriere will store jails and ports
Default value: '/usr/local/poudriere'
poudriere_data
Data type: String[1]
The directory where the jail will store the packages and logs
Default value: '${BASEFS}/data'
use_portlint
Data type: Enum['yes', 'no']
Use portlint to check ports sanity
Default value: 'no'
mfssize
Data type: Optional[String[1]]
Size of WRKDIRPREFIX when using mdmfs
Default value: undef
tmpfs
Data type: Poudriere::Tmpfs
Use tmpfs(5)
Default value: 'yes'
tmpfs_limit
Data type: Optional[Integer[1]]
How much memory to limit tmpfs size to for each builder in GiB
Default value: undef
tmpfs_blacklist
Data type: Optional[Array[String[1]]]
List of package globs that are not allowed to use tmpfs
Default value: undef
tmpfs_blacklist_tmpdir
Data type: Optional[String[1]]
The host path where tmpfs-blacklisted packages can be built in
Default value: undef
max_memory
Data type: Optional[Integer[1]]
How much memory to limit jail processes to for each builder
Default value: undef
max_memory_per_package
Data type: Hash[String[1], Integer[1]]
Override max_memory per package
Default value: {}
max_files
Data type: Optional[Integer[1]]
How many file descriptors to limit each jail process to
Default value: undef
distfiles_cache
Data type: Stdlib::Absolutepath
Directory used for the distfiles
Default value: '/usr/ports/distfiles'
git_baseurl
Data type: Optional[String[1]]
Git URL to use to fetch base
Default value: undef
git_portsurl
Data type: Optional[String[1]]
Git URL to use to fecth ports
Default value: undef
svn_host
Data type: Optional[String[1]]
Mirror to use for the ports tree or source tree when using SVN
Default value: undef
check_changed_options
Data type: Enum['yes', 'no', 'verbose']
Enable automatic OPTION change detection
Default value: 'verbose'
check_changed_deps
Data type: Enum['yes', 'no']
Enable automatic dependency change detection
Default value: 'yes'
bad_pkgname_deps_are_fatal
Data type: Optional[Enum['yes', 'no']]
Consider bad dependency lines on the wrong PKGNAME as fatal
Default value: undef
pkg_repo_signing_key
Data type: Optional[String[1]]
Path to the RSA key to sign the PKG repo with
Default value: undef
signing_command
Data type: Optional[String[1]]
Command to sign the PKG repo with
Default value: undef
pkg_repo_from_host
Data type: Optional[Enum['yes', 'no']]
Sign the PKG repo from the host
Default value: undef
ccache_enable
Data type: Boolean
Enable ccache
Default value: false
ccache_dir
Data type: Stdlib::Absolutepath
Path to the ccache cache directory
Default value: '/var/cache/ccache'
ccache_static_prefix
Data type: Optional[Stdlib::Absolutepath]
Static ccache support from host
Default value: undef
restrict_networking
Data type: Optional[Enum['yes', 'no']]
The jails normally only allow network access during the 'make fetch' phase.
Default value: undef
allow_networking_packages
Data type: Optional[String[1]]
Allow networking for a subset of packages
Default value: undef
disallow_networking
Data type: Optional[Enum['yes', 'no']]
Fully disabled networking
Default value: undef
allow_make_jobs_packages
Data type: Optional[String[1]]
Allow networking for a subset of packages when building
Default value: undef
parallel_jobs
Data type: Integer[1]
Override the number of builders
Default value: $facts['processors']['count']
prepare_parallel_jobs
Data type: Optional[Integer[1]]
How many jobs should be used for preparing the build
Default value: undef
save_wrkdir
Data type: Optional[String[1]]
Save the WRKDIR to ${POUDRIERE_DATA}/wrkdirs on failure
Default value: undef
wrkdir_archive_format
Data type: Optional[String[1]]
Format for the workdir packing
Default value: undef
nolinux
Data type: Optional[String[1]]
Disable Linux support
Default value: undef
no_force_package
Data type: Optional[Enum['yes', 'no']]
Do not set FORCE_PACKAGE
Default value: undef
no_package_building
Data type: Optional[String[1]]
Do not set PACKAGE_BUILDING
Default value: undef
http_proxy
Data type: Optional[String[1]]
HTTP proxy
Default value: undef
ftp_proxy
Data type: Optional[String[1]]
FTP proxy
Default value: undef
no_restricted
Data type: Optional[String[1]]
Cleanout the restricted packages
Default value: undef
allow_make_jobs
Data type: Optional[String[1]]
Do not bound the number of processes to the number of cores
Default value: undef
allow_make_jobs_packages
List of packages that will always be allowed to use MAKE_JOBS regardless of ALLOW_MAKE_JOBS
Default value: undef
timestamp_logs
Data type: Optional[Enum['yes', 'no']]
Timestamp every line of build logs
Default value: undef
max_execution_time
Data type: Optional[Integer[1]]
Set the max time (in seconds) that a command may run for a build before it is killed for taking too long
Default value: undef
nohang_time
Data type: Optional[Integer[1]]
Set the time (in seconds) before a command is considered to be in a runaway state for having no output on stdout
Default value: undef
atomic_package_repository
Data type: Optional[Enum['yes', 'no']]
Update the repository atomically
Default value: undef
commit_packages_on_failure
Data type: Optional[Enum['yes', 'no']]
When using ATOMIC_PACKAGE_REPOSITORY, commit the packages if some packages fail to build
Default value: undef
keep_old_packages
Data type: Optional[Enum['yes', 'no']]
Keep older package repositories
Default value: undef
keep_old_packages_count
Data type: Optional[Integer[1]]
How many old package repositories to keep with KEEP_OLD_PACKAGES
Default value: undef
porttesting_fatal
Data type: Optional[Enum['yes', 'no']]
Make testing errors fatal
Default value: undef
builder_hostname
Data type: Optional[String[1]]
Define the building jail hostname to be used when building the packages
Default value: undef
preserve_timestamp
Data type: Optional[Enum['yes', 'no']]
Define to get a predictable timestamp on the ports tree
Default value: undef
build_as_non_root
Data type: Optional[String[1]]
Build and stage as a regular user
Default value: undef
portbuild_user
Data type: Optional[String[1]]
Define to the username to build as when BUILD_AS_NON_ROOT is yes
Default value: undef
portbuild_group
Data type: Optional[String[1]]
Define to the groupname to build as when BUILD_AS_NON_ROOT is yes
Default value: undef
portbuild_uid
Data type: Optional[Integer[1]]
Define to the uid to use for PORTBUILD_USER if the user does not already exist in the jail
Default value: undef
portbuild_gid
Data type: Optional[Integer[1]]
Define to the gid to use for PORTBUILD_USER if the group does not already exist in the jail
Default value: undef
priority_boost
Data type: Optional[String[1]]
Define pkgname globs to boost priority for
Default value: undef
buildname_format
Data type: Optional[String[1]]
Define format for buildnames
Default value: undef
duration_format
Data type: Optional[String[1]]
Define format for build duration times
Default value: undef
use_colors
Data type: Optional[Enum['yes', 'no']]
Use colors when in a TTY
Default value: undef
trim_orphaned_build_deps
Data type: Optional[Enum['yes', 'no']]
Only build what is requested
Default value: undef
delete_unknown_files
Data type: Optional[Enum['yes', 'no']]
Whether or not bulk/testport should delete unknown files in the repository
Default value: undef
delete_unqueued_packages
Data type: Optional[Enum['yes', 'always', 'no']]
Whether or not bulk/testport should automatically "pkgclean"
Default value: undef
local_mtree_excludes
Data type: Optional[String[1]]
A list of directories to exclude from leftover and filesystem violation mtree checks
Default value: undef
url_base
Data type: Optional[String[1]]
URL where your POUDRIERE_DATA/logs are hosted
Default value: undef
html_type
Data type: Optional[Enum['hosted', 'inline']]
Set to hosted to use the /data directory instead of inline style HTML
Default value: undef
html_track_remaining
Data type: Optional[Enum['yes', 'no']]
Set to track remaining ports in the HTML interface
Default value: undef
determine_build_failure_reason
Data type: Optional[Enum['yes', 'no']]
Grep build logs to determine a possible build failure reason
Default value: undef
makeworldargs
Data type: Optional[String[1]]
Pass arguments to buildworld
Default value: undef
package_fetch_branch
Data type: Optional[String[1]]
Set to always attempt to fetch packages or dependencies before building
Default value: undef
package_fetch_url
Data type: Optional[String[1]]
The fetch URL
Default value: undef
package_fetch_blacklist
Data type: Optional[Array[String[1]]]
Packages which should never be fetched
Default value: undef
package_fetch_whitelist
Data type: Optional[Array[String[1]]]
Allow only specific packages to be fetched
Default value: undef
environments
Data type: Hash
Build environments to manage
Default value: {}
portstrees
Data type: Hash
Port trees to manage
Default value: {}
xbuild_package
Data type: String[1]
Package to install for cross-building packages
Default value: 'qemu-user-static'
poudriere::xbuild
Install cross-building dependencies
Defined types
poudriere::env
This resource creates a build environment for a given release and architecture of FreeBSD. Passing in custom options gives you the ability to turn on and off certain features of your ports. Specific make options you would put in make.conf, you can pass here as well. Automatic periodic building of packages is managed with the cron_enable parameter
Parameters
The following parameters are available in the poudriere::env
defined type:
version
ensure
makeopts
makefile
arch
jail
paralleljobs
pkgs
pkg_file
pkg_makeopts
pkg_optsdir
portstree
cron_enable
cron_always_mail
cron_interval
version
Data type: String[1]
Version of the jail
ensure
Data type: Enum['present', 'absent']
The desired state of this environment
Default value: 'present'
makeopts
Data type: Array[String[1]]
Build options
Default value: []
makefile
Data type: Optional[String[1]]
Path to a Makefile
Default value: undef
arch
Data type: Optional[Poudriere::Architecture]
Architecture of the jail
Default value: undef
jail
Data type: String[1]
Name of the jail
Default value: $name
paralleljobs
Data type: Integer[1]
Override the number of builders
Default value: $facts['processors']['count']
pkgs
Data type: Array[String[1]]
List of packages to build
Default value: []
pkg_file
Data type: Optional[Stdlib::Absolutepath]
Puppet path to a list of packages to build
Default value: undef
pkg_makeopts
Data type: Hash
Per package build options
Default value: {}
pkg_optsdir
Data type: Optional[Stdlib::Absolutepath]
Path to a directory of build options
Default value: undef
portstree
Data type: String[1]
The port tree to use
Default value: 'default'
cron_enable
Data type: Boolean
Enable automatic updates
Default value: false
cron_always_mail
Data type: Boolean
Always send an e-mail on update
Default value: false
cron_interval
Data type: Poudriere::Cron_interval
Scheduling of automatic updates
Default value: { minute => 0, hour => 0, monthday => '*', month => '*', weekday => '*' }
poudriere::portstree
This resource creates a ports tree. You can have multiple ports trees for different building purposes. Automatic periodic updating of packages is managed with the cron_enable parameter
Parameters
The following parameters are available in the poudriere::portstree
defined type:
ensure
Data type: Enum['present', 'absent']
The desired state of this ports tree
Default value: 'present'
portstree
Data type: String[1]
Name of the ports tree
Default value: $name
branch
Data type: Optional[String[1]]
Branch to checkout when using the svn or git methods
Default value: undef
fetch_method
Data type: Poudriere::Fetch_method
Specify which method to use to create the ports tree
Default value: 'svn'
mountpoint
Data type: Optional[Stdlib::Absolutepath]
Path to the source of a ports tree.
Default value: undef
cron_enable
Data type: Boolean
Enable automatic updates
Default value: false
cron_always_mail
Data type: Boolean
Always send an e-mail on update
Default value: false
cron_interval
Data type: Poudriere::Cron_interval
Scheduling of automatic updates
Default value: { minute => 0, hour => 22, monthday => '*', month => '*', week => '*' }
Data types
Poudriere::Architecture
The architecture to target when building packages
- Note This list can be obtained from the FreeBSD src directory with
make targets | awk -F '( +|/)' 'NR > 1 { if ($2 == $3) { print $2 }; print $2"."$3 }'
Alias of Enum['amd64', 'amd64.amd64', 'arm', 'arm.arm', 'arm.armv6', 'arm.armv7', 'arm64.aarch64', 'i386', 'i386.i386', 'mips.mipsel', 'mips', 'mips.mips', 'mips.mips64el', 'mips.mips64', 'mips.mipsn32', 'mips.mipselhf', 'mips.mipshf', 'mips.mips64elhf', 'mips.mips64hf', 'powerpc', 'powerpc.powerpc', 'powerpc.powerpc64', 'powerpc.powerpcspe', 'riscv.riscv64', 'riscv.riscv64sf', 'sparc64', 'sparc64.sparc64']
Poudriere::Cron_interval
Parameters to configure Poudriere's cron resources
Alias of
Struct[{
minute => Optional[Variant[Integer, String]],
hour => Optional[Variant[Integer, String]],
monthday => Optional[String],
month => Optional[String],
week => Optional[String],
weekday => Optional[String],
}]
Poudriere::Fetch_method
A supported fetch method for poudriere
Alias of Enum['git', 'git+http', 'git+https', 'git+ssh', 'null', 'portsnap', 'svn', 'svn+file', 'svn+http', 'svn+https', 'svn+ssh']
Poudriere::Tmpfs
A supported tmpfs setting for poudriere
Alias of
Variant[Enum[
'all',
'no',
'yes',
], Array[
Enum[
'data',
'localbase',
'wrkdir',
],
]]
Changelog
All notable changes to this project will be documented in this file. Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module.
v3.1.0 (2024-02-07)
Implemented enhancements:
v3.0.0 (2023-07-10)
Breaking changes:
- Drop Puppet 6 support #76 (bastelfreak)
- Drop support for FreeBSD 11 (EOL) #68 (smortex)
Implemented enhancements:
- Add support for Puppet 8 #79 (smortex)
- Relax dependencies version requirements #78 (smortex)
- Add support for the latest poudriere options #73 (smortex)
- Allow to build with port outside of /usr/ports #71 (kapouik)
- Add support for FreeBSD 13 #69 (smortex)
Merged pull requests:
v2.0.0 (2021-06-15)
Breaking changes:
- Drop EoL Puppet 5 support; Add Puppet 7 #63 (smortex)
- Sync poudriere.conf template with recent release #58 (smortex)
- Do not hardcode a default version in poudriere::env #57 (smortex)
- Use the FreeBSD "central server" for downloads #56 (smortex)
- Prefer optional non-empty strings #53 (smortex)
Implemented enhancements:
- Switch to EPP templates #61 (smortex)
- Allow to specify a mountpoint when creating a portstree #55 (smortex)
Fixed bugs:
Closed issues:
- Module modernization and cleanup #52
Merged pull requests:
- Rework $poudriere::env::arch #54 (smortex)
- Use data types for all parameters #51 (smortex)
- modulesync 3.0.0 & puppet-lint updates #45 (bastelfreak)
v1.4.0 (2020-04-27)
Merged pull requests:
1.3.0 (2019-12-28)
Merged pull requests:
- Add support for portstree branch #39 (jdmulloy)
- Fix detection of created jails #38 (jdmulloy)
- Fix SAVE_WRKDIR #37 (jdmulloy)
- Update from xaque208 modulesync_config #36 (zachfi)
- Update from xaque208 modulesync_config #35 (zachfi)
1.2.1 (2019-02-27)
Merged pull requests:
1.2.0 (2019-02-02)
Merged pull requests:
1.1.0 (2018-05-27)
Merged pull requests:
1.0.3 (2018-02-11)
Closed issues:
- Still need cron_enable in init.pp manifest #24
Merged pull requests:
1.0.2 (2017-01-28)
Merged pull requests:
1.0.1 (2016-04-04)
Merged pull requests:
1.0.0 (2015-10-19)
Merged pull requests:
0.1.5 (2015-10-08)
Closed issues:
- Symlinks not supported #21
Merged pull requests:
0.1.4 (2015-02-08)
Merged pull requests:
- Update testing #22 (zachfi)
- Syntax fix in README #20 (tbartelmess)
0.1.3 (2014-11-25)
Merged pull requests:
0.1.2 (2014-11-09)
Merged pull requests:
0.1.1 (2014-10-19)
Merged pull requests:
0.1.0 (2014-07-11)
Merged pull requests:
0.0.9 (2014-07-01)
Closed issues:
- latest issue has syntax error #12
- poudriere error: Unknown value for USE_TMPFS #7
- Add support for package options #1
Merged pull requests:
- Cron support #15 (skoef)
- Addtests #14 (zachfi)
- Add tests #13 (zachfi)
- Cron support, example for exporting pkgng repo and some cleaning #11 (skoef)
- make all config file options variables so they can be edited #10 (sethlyons)
- Update tmpfs setting for #7 #8 (zachfi)
- Base Folder/tmpfs #6 (DJClean)
- Add proxy ability #5 (DJClean)
0.0.8 (2014-01-11)
Merged pull requests:
- add support for package-specific make options through pkg_makeopts #4 (lifeforms)
- allow NO_ZFS by setting zpool to false or '' #3 (lifeforms)
- fetch ports by svn: portsnap does not allow non-interactive use #2 (lifeforms)
0.0.7 (2013-02-07)
0.0.6 (2013-02-07)
0.0.5 (2013-02-05)
0.0.4 (2012-12-20)
0.0.1 (2012-10-16)
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 5.0.0 < 10.0.0)