Forge Home


Puppet types and providers for Gentoo portage


1,160,447 latest version

3.8 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 2.3.0 (latest)
  • 2.2.0
  • 2.2.0-rc1 (pre-release)
  • 2.1.0
  • 2.0.1
released Jul 24th 2015

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'gentoo-portage', '2.3.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add gentoo-portage
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install gentoo-portage --version 2.3.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.



gentoo/portage — version 2.3.0 Jul 24th 2015

Puppet Gentoo Portage Module

Provides Gentoo Portage features for Puppet.

Travis Test status: Build



package_use { 'app-admin/puppet':
  use     => ['flag1', 'flag2'],
  target  => 'puppet-flags',
  version => '>=3.0.1',
  ensure  => present,

use can be either a string or an array of strings.


package_keywords { 'app-admin/puppet':
  keywords => ['~x86', '-hppa'],
  target   => 'puppet',
  version  => '>=3.0.1',
  ensure   => present,

keywords can be either a string or an array of strings.


package_unmask { 'app-admin/puppet':
  target  => 'puppet',
  version => '>=3.0.1',
  ensure  => present,


package_mask { 'app-admin/puppet':
  target  => 'tree',
  version => '>=3.0.1',
  ensure  => present,


package_env { 'www-client/firefox':
  env     => 'no-lto',
  target  => 'firefox',
  version => '>=20.0',
  ensure  => present,

env can be either a string or an array of strings.


The default location of make.conf is /etc/portage/make.conf If you want to change it, you should do the following:

class { 'portage':
  make_conf = '/etc/make.conf',

In order to add entries to make.conf:

portage::makeconf { 'portdir_overlay':
  content => '/var/lib/layman',
  ensure  => present,
portage::makeconf { 'use':
  content => ['flag1', 'flag2'],
  ensure  => present,

Changes in make.conf will also trigger re-emerge of the affected packages. You can disable this behaviour by setting make_conf_remerge to false.

You can also specify special content:

portage::makeconf { 'source /var/lib/layman/make.conf': }


This module provides a wrapper to the native package type:

portage::package { 'app-admin/puppet':
  use              => ['-minimal', 'augeas'],
  use_version      => '>=3.0.1',
  keywords         => ['~amd64', '~x86'],
  keywords_version => '>=3.0.1',
  mask_version     => '<=2.3.17',
  unmask_version   => '>=3.0.1',
  target           => 'puppet',
  keywords_target  => 'puppet-keywords',
  ensure           => '3.0.1',

If no {keywords,use,mask,unmask}\_target is specified, then the value of target is being used. The variables keywords, mask and unmask also accept the special value all, that will create versionless entries. (This applies only to portage::package, if you want versionless entries in any of the above package\_\* types, you can just omit the version attribute.) Any change in portage::package will also trigger the appropriate re-emerge to the affected package.


All make.conf variables and most of the eselect modules are shown by facter


The eselect type/provider checks for the current state of an eselect module (or gcc-config) by reading the currently selected value.

eselect { 'ruby':
  set => 'ruby19',

Some eselect modules have special options or submodules:

eselect { 'python::python2':
  set => 'python2.7',

eselect { 'php::apache2':
  set => 'php5.3',


The webapp type/provider can be used to manage webapps via webapp-config.

webapp { '':
  appname    => 'django',
  appversion => '1.4.5',
  server     => 'nginx',
  user       => 'nginx',
  group      => 'nginx',
  secure     => 'yes',


The layman type/provider can be used to manage overlays via layman.

layman { 'x11':
  ensure => present,

Custom overlay list can be used via overlay_list parameter.

layman { 'custom-overlay':
  ensure => present,
  overlay_list => 'https://some.xml.file.somethere',

Installation of Gentoo tools

This module can also handle the installation of various Gentoo tools.

class { 'portage':
  portage_ensure => '2.2.6',
  eix_ensure     => '0.29.4',
  eix_keywords   => ['~amd64', '~x86'],

See manifests/init.pp for all the available tools that can be defined. (It is recommended to use hiera in order to define the values)

See Also