Cookbooks
freebsd
Readme

freebsd Cookbook

Cookbook Version (opens in a new tab) CI State (opens in a new tab) OpenCollective OpenCollective License (opens in a new tab)

Sets up ports and pkgng on FreeBSD systems

Maintainers

This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit sous-chefs.org (opens in a new tab) or come chat with us on the Chef Community Slack in #sous-chefs (opens in a new tab).

Requirements

Platforms

  • FreeBSD

Chef

  • Chef 15.3+

Cookbooks

  • none

Attributes

AttributeDefaultDescription
node['freebsd']['compiletime_portsnap']falseExecute portsnap resources at compile time

Supported Versions

This cookbook will support stable and release versions (opens in a new tab) of the FreeBSD Platform. More information on this subject can be found at issue23 (opens in a new tab).

Usage

freebsd::portsnap

This recipe ensures the Ports Collection collection is fully up to date.

This recipe should appear first in the run list of FreeBSD nodes to ensure that the package cache is up to date before managing any package resources with Chef.

Resources

port_options

Provides an easy way to set port options from within a cookbook.

It can be used in two different ways:

  • template-based: specifying a source will write it to the correct destination with no change;
  • options hash: if a options hash is passed instead, it will be merged on top of default and current options, and the result will be written back.

Note that the options hash take simple options names as keys and a boolean as value; when saving to file, this is converted to the format that FreeBSD ports expect:

Option Key NameOption ValueOptions File
APACHEtrueWITH_APACHE=true
APACHEfalseWITHOUT_APACHE=true

Actions

ActionDescriptionDefault
createcreate the port options file according to the given optionsYes

Properties

PropertyDescription
nameThe name of the port whose options file you want to manipulate;
sourceif the property is set, it will be used to look up a template, which will then be saved as a port options file
optionsa hash with the option name as the key, and a boolean as value.

Examples

# freebsd-php5-options will be written out as /var/db/ports/php5/options
freebsd_port_options 'php5' do
  source 'freebsd-php5-options.erb'
  action :create
end
 
# Default options will be read from /usr/ports/lang/php5;
# current options from /var/db/ports/php5/options (if exists);
# the APACHE options will be set to true, the others will be unchanged
freebsd_port_options 'php5' do
  options 'APACHE' => true
  action :create
end

Contributors

This project exists thanks to all the people who contribute. (opens in a new tab)

Backers

Thank you to all our backers!

https://opencollective.com/sous-chefs#backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

https://opencollective.com/sous-chefs/sponsor/0/website https://opencollective.com/sous-chefs/sponsor/1/website https://opencollective.com/sous-chefs/sponsor/2/website https://opencollective.com/sous-chefs/sponsor/3/website https://opencollective.com/sous-chefs/sponsor/4/website https://opencollective.com/sous-chefs/sponsor/5/website https://opencollective.com/sous-chefs/sponsor/6/website https://opencollective.com/sous-chefs/sponsor/7/website