Forge Home


Manages the Perforce Ruby API (p4ruby)


7,831 latest version

4.3 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

  • 0.1.1 (latest)
  • 0.1.0
released Jan 26th 2016
This version is compatible with:
  • Puppet Enterprise >= 3.0.0 < 2015.4.0
  • Puppet >= 3.0.0 < 5.0.0
  • , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'alanpetersen-p4ruby', '0.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add alanpetersen-p4ruby
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install alanpetersen-p4ruby --version 0.1.1

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.



alanpetersen/p4ruby — version 0.1.1 Jan 26th 2016



This module manages the Perforce Ruby API (p4ruby) on a node.


This module does not install Ruby on the target system (although it does ensure that rubygems is installed).


At its simplest, you can manage the p4ruby installation on your system.

include p4ruby

This will install the p4ruby gem. During installation of the gem, the P4 C++ API (p4api) will be downloaded and installed. If you would like to control which P4API the p4ruby gem uses, you can specify the p4api_dir parameter when declaring the p4ruby class. An example of using both the p4api and p4ruby modules together is given below:

$perforce_dir = '/opt/perforce'
$p4api_dir = "${perforce_dir}/p4api"

class { 'p4api':
  base_perforce_dir => $perforce_dir,

class { 'p4ruby':
  p4api_dir => $p4api_dir,


Currently, only RedHat/CentOS and Ubuntu are supported.