Giter Club home page Giter Club logo

puppet-poudriere's Introduction

Puppet-poudriere

Build Status Code Coverage Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores License

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

puppet-poudriere's People

Contributors

b4ldr avatar bastelfreak avatar dhoppe avatar ghoneycutt avatar igalic avatar jdmulloy avatar lifeforms avatar maxadamo avatar oranenj avatar phyber avatar skoef avatar smortex avatar tbartelmess avatar zachfi avatar zilchms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-poudriere's Issues

poudriere error: Unknown value for USE_TMPFS

Error from puppet:

debug: Executing '/usr/local/bin/poudriere ports -c -m svn'
err: /Stage[main]/Poudriere/Exec[create default ports tree]/returns: change from notrun to 0 failed: /usr/local/bin/poudriere ports -c -m svn returned 1 instead of one of [0] at /etc/puppet/environments/freebsd/modules/poudriere/manifests/init.pp:40

Running manually

# /usr/local/bin/poudriere ports -c -m svn
====>> Error: Unknown value for USE_TMPFS can be a combination of wrkdir,data,all,yes,localbase

This seems to be because the default "YES" is not a valid input. From the config file:

# Use tmpfs(5)
# This can be a space-separated list of options:
# wrkdir    - Use tmpfs(5) for port building WRKDIRPREFIX
# data      - Use tmpfs(5) for poudriere cache/temp build data
# localbase - Use tmpfs(5) for LOCALBASE (installing ports for packaging/testing)
# all       - Run the entire build in memory, including builder jails.
# yes       - Only enables tmpfs(5) for wrkdir
# EXAMPLE: USE_TMPFS="wrkdir data"
USE_TMPFS=YES

Perhaps the default should be "yes"?

Add support for package options

It would be nice if this module would support setting package options (manage options files). Data could be retrieved from hiera.

Symlinks not supported

Report from Puppet shows that symlinks are not supported:

Warning: Symlinks in modules are unsupported. Please investigate symlink zleslie-poudriere-0.1.3/spec/fixtures/modules/poudriere/manifests->../../../../manifests.
Warning: Symlinks in modules are unsupported. Please investigate symlink zleslie-poudriere-0.1.3/spec/fixtures/modules/poudriere/templates->../../../../templates.

I'm sure duplication of files are not optimal, however it appears that per Puppet v3.7.1 this isn't supported.

latest issue has syntax error

as of the latest version, there seems to be an error in env.pp

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '['; expected ']' at /etc/puppet/environments/production/modules/poudriere/manifests/env.pp:41 on node nj1ipinfra001.fxcorp
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Module modernization and cleanup

While working on #51, I spotted a bunch of things that where beyond the scope of this PR but where annoying / weird for me, so I open this issue to list these points so that maintainers can tell what they thing about it and we can track the overall progress.

Here is a checklist of the things I spotted and am willing to fix. I propose to have these items checked when the maintainers are OK with it, then add a link to a PR when one is ready, and strike-out the lines when the PR are merged.

  • #51 (merged) — Add data-types for all parameters
  • #53 (merged) — The module use default values of '' for optional values… Change these to undef and use a Optional[String[1]] data type for these items
  • poudriere::zpool default value is currently tank, a term commonly found with ZFS but is the name of the pool the end-user want sot use only when they are super-lucky… Maybe it's worth change it:
    • #53 (merged) — default poudriere::zpool to undef (do not set a default value, poudriere can work without ZFS (at least, support for this was added at some point))
    • (abandoned) default poudriere::zpool to zroot (default pool name when installing FreeBSD with ZFS on root)
  • #56 (merged) — poudriere::freebsd_host default to a specific mirror, change it to http://ftp.FreeBSD.org/, which is made up of many machines operated by the project cluster administrators and behind GeoDNS to direct users to the closest available mirror
  • #54 (merged) — The default version of env::architecture is hardcoded to amd64. Default to the architecture of the node.
  • #57 (merged) — The default version of env::version is hardcoded to an old release. Default to undef and force the user to specify explicitly what version they want.
  • #58 (merged) Sync configuration file parameters with latest poudriere settings
  • #61 Switch from ERB to EPP
  • #58 (1/2, merged), #59 (2/2, merged) — Extend the test suite with tests that set all parameters (we seem to have some parameters which lead to broken catalogs when used)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.