Forge Home

nginx_passenger

Puppet module for Nginx through Passenger

11,727 downloads

10,372 latest version

2.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.5 (latest)
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
  • 0.1.0
released Mar 12th 2014

Start using this module

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

Add this module to your Puppetfile:

mod 'kbatra-nginx_passenger', '0.1.5'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add kbatra-nginx_passenger
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install kbatra-nginx_passenger --version 0.1.5

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

kbatra/nginx_passenger — version 0.1.5 Mar 12th 2014

Puppet Nginx Passenger Module

This is a fork of puppet-nginx-passenger to install nginx with passenger using default ruby version on debian wheezy or ubuntu precise.

After inclusion, this module ensures that any user in group www-data is able to deploy through tools such as capistrano or mina, this of course as long as you have right ssh configuration (keys or forwarding) in place.

This module installs Nginx using puppet-rvm. Please, read the documentation before you begin. This module has been tested on Ubuntu Precise (12.04). For custom types, do not forget to enable pluginsync:

[main]
pluginsync = true

Basic usage

Install nginx_passenger with

include nginx_passenger

By default installs on /opt/nginx, there are some variables you might override

class {'nginx_passenger':
    ruby_version      => 'ruby-1.9.3-p125',
    passenger_version => '4.0.23',
    installdir        => '/opt/nginx',
    logdir            => '/var/log/nginx',
    www               => '/var/www',
}

A custom installation might look like this:

node webserver {
    class { 'nginx_passenger':
      installdir => '/usr/local/nginx',
      logdir     => '/usr/local/logs/nginx',
    }
}

An advanced installation using nginx source would look like the following. Take a look at the pagespeed module for help with downloading the source.

class { 'nginx_passenger':
    nginx_source_dir => '/home/vagrant/nginx-1.4.2',
    nginx_extra_configure_flags =>  '--add-module=/home/vagrant/ngx_pagespeed-release-1.6.29.5-beta'
}

Virtual Hosts

You can easily configure a virtual host. An example is:

nginx::vhost { 'www.example.com':
    port => '8080'
    rails => true,
}

The rails attribute is optional and set to false by default. However, if you want to deploy a rails app, use this attribute and the rails template will be used instead.

SSL

You can enable SSL for a virtual host like so:

nginx_passenger::vhost { 'www.example.com': 
  ssl  => on,
  ssl_certificate  => '/etc/ssl/example.crt',
  ssl_certificate_key => '/etc/ssl/example.key',
  ssl_default_server => true    # optional, to set this as default SSL server
}

MIT License

Copyright (C) 2012 by Sergio Galván

Copyright (C) 2013 by Karan Batra

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN