Puppet Class: poudriere

Defined in:
manifests/init.pp

Overview

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.

Parameters:

  • zpool (Optional[String[1]]) (defaults to: undef)

    The pool where poudriere will create all the filesystems

  • zrootfs (Stdlib::Absolutepath) (defaults to: '/poudriere')

    The root of the poudriere zfs filesystem

  • freebsd_host (String[1]) (defaults to: 'http://ftp.freebsd.org/')

    The host where to download sets for the jails setup

  • resolv_conf (Stdlib::Absolutepath) (defaults to: '/etc/resolv.conf')

    A file on your hosts system that will be copied has /etc/resolv.conf for the jail

  • poudriere_base (Stdlib::Absolutepath) (defaults to: '/usr/local/poudriere')

    The directory where poudriere will store jails and ports

  • poudriere_data (String[1]) (defaults to: '${BASEFS}/data')

    The directory where the jail will store the packages and logs

  • use_portlint (Enum['yes', 'no']) (defaults to: 'no')

    Use portlint to check ports sanity

  • mfssize (Optional[String[1]]) (defaults to: undef)

    Size of WRKDIRPREFIX when using mdmfs

  • tmpfs (Poudriere::Tmpfs) (defaults to: 'yes')

    Use tmpfs(5)

  • tmpfs_limit (Optional[Integer[1]]) (defaults to: undef)

    How much memory to limit tmpfs size to for each builder in GiB

  • tmpfs_blacklist (Optional[Array[String[1]]]) (defaults to: undef)

    List of package globs that are not allowed to use tmpfs

  • tmpfs_blacklist_tmpdir (Optional[String[1]]) (defaults to: undef)

    The host path where tmpfs-blacklisted packages can be built in

  • max_memory (Optional[Integer[1]]) (defaults to: undef)

    How much memory to limit jail processes to for each builder

  • max_memory_per_package (Hash[String[1], Integer[1]]) (defaults to: {})

    Override max_memory per package

  • max_files (Optional[Integer[1]]) (defaults to: undef)

    How many file descriptors to limit each jail process to

  • distfiles_cache (Stdlib::Absolutepath) (defaults to: '/usr/ports/distfiles')

    Directory used for the distfiles

  • git_baseurl (Optional[String[1]]) (defaults to: undef)

    Git URL to use to fetch base

  • git_portsurl (Optional[String[1]]) (defaults to: undef)

    Git URL to use to fecth ports

  • svn_host (Optional[String[1]]) (defaults to: undef)

    Mirror to use for the ports tree or source tree when using SVN

  • check_changed_options (Enum['yes', 'no', 'verbose']) (defaults to: 'verbose')

    Enable automatic OPTION change detection

  • check_changed_deps (Enum['yes', 'no']) (defaults to: 'yes')

    Enable automatic dependency change detection

  • bad_pkgname_deps_are_fatal (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Consider bad dependency lines on the wrong PKGNAME as fatal

  • pkg_repo_signing_key (Optional[String[1]]) (defaults to: undef)

    Path to the RSA key to sign the PKG repo with

  • signing_command (Optional[String[1]]) (defaults to: undef)

    Command to sign the PKG repo with

  • pkg_repo_from_host (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Sign the PKG repo from the host

  • ccache_enable (Boolean) (defaults to: false)

    Enable ccache

  • ccache_dir (Stdlib::Absolutepath) (defaults to: '/var/cache/ccache')

    Path to the ccache cache directory

  • ccache_static_prefix (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    Static ccache support from host

  • restrict_networking (Optional[Enum['yes', 'no']]) (defaults to: undef)

    The jails normally only allow network access during the ‘make fetch’ phase.

  • allow_networking_packages (Optional[String[1]]) (defaults to: undef)

    Allow networking for a subset of packages

  • disallow_networking (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Fully disabled networking

  • allow_make_jobs_packages (Optional[String[1]]) (defaults to: undef)

    Allow networking for a subset of packages when building

  • parallel_jobs (Integer[1]) (defaults to: $facts['processors']['count'])

    Override the number of builders

  • prepare_parallel_jobs (Optional[Integer[1]]) (defaults to: undef)

    How many jobs should be used for preparing the build

  • save_wrkdir (Optional[String[1]]) (defaults to: undef)

    Save the WRKDIR to $POUDRIERE_DATA/wrkdirs on failure

  • wrkdir_archive_format (Optional[String[1]]) (defaults to: undef)

    Format for the workdir packing

  • nolinux (Optional[String[1]]) (defaults to: undef)

    Disable Linux support

  • no_force_package (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Do not set FORCE_PACKAGE

  • no_package_building (Optional[String[1]]) (defaults to: undef)

    Do not set PACKAGE_BUILDING

  • http_proxy (Optional[String[1]]) (defaults to: undef)

    HTTP proxy

  • ftp_proxy (Optional[String[1]]) (defaults to: undef)

    FTP proxy

  • no_restricted (Optional[String[1]]) (defaults to: undef)

    Cleanout the restricted packages

  • allow_make_jobs (Optional[String[1]]) (defaults to: undef)

    Do not bound the number of processes to the number of cores

  • allow_make_jobs_packages (defaults to: undef)

    List of packages that will always be allowed to use MAKE_JOBS regardless of ALLOW_MAKE_JOBS

  • timestamp_logs (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Timestamp every line of build logs

  • max_execution_time (Optional[Integer[1]]) (defaults to: undef)

    Set the max time (in seconds) that a command may run for a build before it is killed for taking too long

  • nohang_time (Optional[Integer[1]]) (defaults to: undef)

    Set the time (in seconds) before a command is considered to be in a runaway state for having no output on stdout

  • atomic_package_repository (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Update the repository atomically

  • commit_packages_on_failure (Optional[Enum['yes', 'no']]) (defaults to: undef)

    When using ATOMIC_PACKAGE_REPOSITORY, commit the packages if some packages fail to build

  • keep_old_packages (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Keep older package repositories

  • keep_old_packages_count (Optional[Integer[1]]) (defaults to: undef)

    How many old package repositories to keep with KEEP_OLD_PACKAGES

  • porttesting_fatal (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Make testing errors fatal

  • builder_hostname (Optional[String[1]]) (defaults to: undef)

    Define the building jail hostname to be used when building the packages

  • preserve_timestamp (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Define to get a predictable timestamp on the ports tree

  • build_as_non_root (Optional[String[1]]) (defaults to: undef)

    Build and stage as a regular user

  • portbuild_user (Optional[String[1]]) (defaults to: undef)

    Define to the username to build as when BUILD_AS_NON_ROOT is yes

  • portbuild_group (Optional[String[1]]) (defaults to: undef)

    Define to the groupname to build as when BUILD_AS_NON_ROOT is yes

  • portbuild_uid (Optional[Integer[1]]) (defaults to: undef)

    Define to the uid to use for PORTBUILD_USER if the user does not already exist in the jail

  • portbuild_gid (Optional[Integer[1]]) (defaults to: undef)

    Define to the gid to use for PORTBUILD_USER if the group does not already exist in the jail

  • priority_boost (Optional[String[1]]) (defaults to: undef)

    Define pkgname globs to boost priority for

  • buildname_format (Optional[String[1]]) (defaults to: undef)

    Define format for buildnames

  • duration_format (Optional[String[1]]) (defaults to: undef)

    Define format for build duration times

  • use_colors (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Use colors when in a TTY

  • trim_orphaned_build_deps (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Only build what is requested

  • delete_unknown_files (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Whether or not bulk/testport should delete unknown files in the repository

  • delete_unqueued_packages (Optional[Enum['yes', 'always', 'no']]) (defaults to: undef)

    Whether or not bulk/testport should automatically “pkgclean”

  • local_mtree_excludes (Optional[String[1]]) (defaults to: undef)

    A list of directories to exclude from leftover and filesystem violation mtree checks

  • url_base (Optional[String[1]]) (defaults to: undef)

    URL where your POUDRIERE_DATA/logs are hosted

  • html_type (Optional[Enum['hosted', 'inline']]) (defaults to: undef)

    Set to hosted to use the /data directory instead of inline style HTML

  • html_track_remaining (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Set to track remaining ports in the HTML interface

  • determine_build_failure_reason (Optional[Enum['yes', 'no']]) (defaults to: undef)

    Grep build logs to determine a possible build failure reason

  • makeworldargs (Optional[String[1]]) (defaults to: undef)

    Pass arguments to buildworld

  • package_fetch_branch (Optional[String[1]]) (defaults to: undef)

    Set to always attempt to fetch packages or dependencies before building

  • package_fetch_url (Optional[String[1]]) (defaults to: undef)

    The fetch URL

  • package_fetch_blacklist (Optional[Array[String[1]]]) (defaults to: undef)

    Packages which should never be fetched

  • package_fetch_whitelist (Optional[Array[String[1]]]) (defaults to: undef)

    Allow only specific packages to be fetched

  • environments (Hash) (defaults to: {})

    Build environments to manage

  • portstrees (Hash) (defaults to: {})

    Port trees to manage

  • xbuild_package (String[1]) (defaults to: 'qemu-user-static')

    Package to install for cross-building packages



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'manifests/init.pp', line 85

class poudriere (
  Optional[String[1]]                $zpool                      = undef,
  Stdlib::Absolutepath               $zrootfs                    = '/poudriere',
  String[1]                          $freebsd_host               = 'http://ftp.freebsd.org/',
  Stdlib::Absolutepath               $resolv_conf                = '/etc/resolv.conf',
  Stdlib::Absolutepath               $poudriere_base             = '/usr/local/poudriere',
  String[1]                          $poudriere_data             = '${BASEFS}/data',
  Enum['yes', 'no']                  $use_portlint               = 'no',
  Optional[String[1]]                $mfssize                    = undef,
  Poudriere::Tmpfs                   $tmpfs                      = 'yes',
  Optional[Integer[1]]               $tmpfs_limit                = undef,
  Optional[Array[String[1]]]         $tmpfs_blacklist            = undef,
  Optional[String[1]]                $tmpfs_blacklist_tmpdir     = undef,
  Optional[Integer[1]]               $max_memory                 = undef,
  Hash[String[1], Integer[1]]        $max_memory_per_package     = {},
  Optional[Integer[1]]               $max_files                  = undef,
  Stdlib::Absolutepath               $distfiles_cache            = '/usr/ports/distfiles',
  Optional[String[1]]                $git_baseurl                = undef,
  Optional[String[1]]                $git_portsurl               = undef,
  Optional[String[1]]                $svn_host                   = undef,
  Enum['yes', 'no', 'verbose']       $check_changed_options      = 'verbose',
  Enum['yes', 'no']                  $check_changed_deps         = 'yes',
  Optional[Enum['yes', 'no']]        $bad_pkgname_deps_are_fatal = undef,
  Optional[String[1]]                $pkg_repo_signing_key       = undef,
  Optional[String[1]]                $signing_command            = undef,
  Optional[Enum['yes', 'no']]        $pkg_repo_from_host         = undef,
  Boolean                            $ccache_enable              = false,
  Stdlib::Absolutepath               $ccache_dir                 = '/var/cache/ccache',
  Optional[Stdlib::Absolutepath]     $ccache_static_prefix       = undef,
  Optional[Enum['yes', 'no']]        $restrict_networking        = undef,
  Optional[String[1]]                $allow_networking_packages  = undef,
  Optional[Enum['yes', 'no']]        $disallow_networking        = undef,
  Integer[1]                         $parallel_jobs              = $facts['processors']['count'],
  Optional[Integer[1]]               $prepare_parallel_jobs      = undef,
  Optional[String[1]]                $save_wrkdir                = undef,
  Optional[String[1]]                $wrkdir_archive_format      = undef,
  Optional[String[1]]                $nolinux                    = undef,
  Optional[Enum['yes', 'no']]        $no_force_package           = undef,
  Optional[String[1]]                $no_package_building        = undef,
  Optional[String[1]]                $http_proxy                 = undef,
  Optional[String[1]]                $ftp_proxy                  = undef,
  Optional[String[1]]                $no_restricted              = undef,
  Optional[String[1]]                $allow_make_jobs            = undef,
  Optional[String[1]]                $allow_make_jobs_packages   = undef,
  Optional[Enum['yes', 'no']]        $timestamp_logs             = undef,
  Optional[Integer[1]]               $max_execution_time         = undef,
  Optional[Integer[1]]               $nohang_time                = undef,
  Optional[Enum['yes', 'no']]        $atomic_package_repository  = undef,
  Optional[Enum['yes', 'no']]        $commit_packages_on_failure = undef,
  Optional[Enum['yes', 'no']]        $keep_old_packages          = undef,
  Optional[Integer[1]]               $keep_old_packages_count    = undef,
  Optional[Enum['yes', 'no']]        $porttesting_fatal          = undef,
  Optional[String[1]]                $builder_hostname           = undef,
  Optional[Enum['yes', 'no']]        $preserve_timestamp         = undef,
  Optional[String[1]]                $build_as_non_root          = undef,
  Optional[String[1]]                $portbuild_user             = undef,
  Optional[String[1]]                $portbuild_group            = undef,
  Optional[Integer[1]]               $portbuild_uid              = undef,
  Optional[Integer[1]]               $portbuild_gid              = undef,
  Optional[String[1]]                $priority_boost             = undef,
  Optional[String[1]]                $buildname_format           = undef,
  Optional[String[1]]                $duration_format            = undef,
  Optional[Enum['yes', 'no']]        $use_colors                 = undef,
  Optional[Enum['yes', 'no']]        $trim_orphaned_build_deps   = undef,
  Optional[Enum['yes', 'no']]        $delete_unknown_files       = undef,
  Optional[Enum['yes', 'always', 'no']] $delete_unqueued_packages = undef,
  Optional[String[1]]                $local_mtree_excludes       = undef,
  Optional[String[1]]                $url_base                   = undef,
  Optional[Enum['hosted', 'inline']] $html_type                  = undef,
  Optional[Enum['yes', 'no']]        $html_track_remaining       = undef,
  Optional[Enum['yes', 'no']]        $determine_build_failure_reason = undef,
  Optional[String[1]]                $makeworldargs              = undef,
  Optional[String[1]]                $package_fetch_branch       = undef,
  Optional[String[1]]                $package_fetch_url          = undef,
  Optional[Array[String[1]]]         $package_fetch_blacklist    = undef,
  Optional[Array[String[1]]]         $package_fetch_whitelist    = undef,
  Hash                               $environments               = {},
  Hash                               $portstrees                 = {},
  String[1]                          $xbuild_package             = 'qemu-user-static',
) {
  if $mfssize { deprecation('mfssize', 'This parameter is deprecated and has no effect.') }

  Exec {
    path => '/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin',
  }

  # Install poudriere and dialog4ports
  # make -C /usr/ports/ports-mgmt/poudriere install clean
  package { ['poudriere', 'dialog4ports']:
    ensure => installed,
  }

  file { '/usr/local/etc/poudriere.conf':
    content => epp('poudriere/poudriere.conf'),
    require => Package['poudriere'],
  }

  file { '/usr/local/etc/poudriere.d':
    ensure  => directory,
  }

  file { $distfiles_cache:
    ensure => directory,
  }

  if $ccache_enable {
    file { $ccache_dir:
      ensure => directory,
    }
  }

  cron { 'poudriere-update-ports':
    ensure   => 'absent',
  }

  # Create environments
  create_resources('poudriere::env', $environments)

  # Create portstrees
  create_resources('poudriere::portstree', $portstrees)
}