A module for managing global Composer dependencies through the Puppet package provider.

Nigel Packer



9,722 latest version

4.2 quality score

Version information

  • 1.0.1 (latest)
  • 1.0.0
released Dec 18th 2014
This version is compatible with:
  • Ubuntu

Start using this module


npacker/composer — version 1.0.1 Dec 18th 2014


Build Status


A Puppet module to provision the PHP dependancy manager, Composer. It adds Composer as a provider to the native Puppet package resource, allowing Composer packages to be provisioned globally.


  • Global Composer installation and setup
  • Global installation of Composer packages via the Puppet package resource


Puppet Forge

It is recommended to install modules via the Puppet Forge in order to automatically satisfy dependences.

puppet module install npacker-composer


This module depends on the following Puppet modules:

In order to install and use Composer, the PHP command-line interface must be installed on the host system.

Supported Platforms

This module supports Puppet in versions >= 3.0.0 < 3.8.0

It has been tested on the following platforms:

  • Ubuntu 14.04 LTS


Install Composer

Global installation of the Composer binary via Puppet manifest:

include composer

Provisioning Composer packages


package { 'drush/drush':
  ensure => present,
  provider => 'composer'


package { 'drush/drush':
  ensure => absent,
  provider => 'composer'


package { 'drush/drush':
  ensure => '6.4.0',
  provider => 'composer'


This module uses rspec-puppet for unit testing. Acceptance testing is currently applied manually in a Vagrant VM to realize application in a simulated server scenario.

Unit Tests

New fixes or features should be accompanied by RSpec tests to verify the integrity of the changes in the overtall codebase. Ideally, the full suite should be checked for a passing status before opening a pull request. The gems necessary for running the test suite are cataloged in the included Gemfile. The bundler gem must be available in the development environment to install rspec-puppet and it's dependencies:

gem install bundler

To initialize the required testing gems, run the following command from the project root:

bundle install

To execute the test suite, navigate the the root directory of a module and run:

bundle exec rake spec

Syntax and Lint

To verify the integrity of the code and formatting, run the rake tasks:

bundle exec rake syntax


bundle exec rake lint

These tasks should pass without errors before opening a pull request.

Acceptance Tests

Currently, this module relies on the manual application of acceptance tests, which are included in the test directories in each module. It is recommended to apply these tests with the --debug and --noop flags. Applying tests in a Vagrant VM allows the environment to be restored after each test run via vagrant destroy. In future, it is planned to use beaker to automate this process.