Forge Home

composer

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

10,897 downloads

10,653 latest version

4.2 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

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

Start using this module

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

Add this module to your Puppetfile:

mod 'npacker-composer', '1.0.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add npacker-composer
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install npacker-composer --version 1.0.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.

Download

Documentation

npacker/composer — version 1.0.1 Dec 18th 2014

npacker-composer

Build Status

Description

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.

Components

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

Installation

Puppet Forge

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

puppet module install npacker-composer

Requirements

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

Usage

Install Composer

Global installation of the Composer binary via Puppet manifest:

include composer

Provisioning Composer packages

Present

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

Absent

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

Versioned

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

Development

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

And:

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.