Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for nginx passenger debian repositories #145

Merged
merged 6 commits into from Oct 7, 2013

Conversation

deric
Copy link
Contributor

@deric deric commented Sep 27, 2013

Phusion company now provides nginx packages with precompiled passenger support

usage:

   class { 'nginx': 
      package_source => 'passenger',
      package_name   => 'nginx-full', # you can choose nginx-light etc.
   }

By default nginx.org repository would be used, if package_source => '' no apt repository would be added, so default distribution ngxinx package would be used.

@deric
Copy link
Contributor Author

deric commented Sep 29, 2013

A configuration for serving puppet master with Nginx and Passenger would look like this:

  class { 'nginx':
    package_source => 'passenger',
    http_cfg_append => {
      'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini',
    }
  }

  nginx::resource::vhost { 'puppet':
    ensure      => present,
    server_name => ['puppet'],
    listen_port => 8140,
    ssl         => true,
    ssl_cert    => '/var/lib/puppet/ssl/certs/example.com.pem',
    ssl_key     => '/var/lib/puppet/ssl/private_keys/example.com.pem',
    ssl_port    => 8140,
    ssl_cache   => 'shared:SSL:128m',
    ssl_ciphers => 'SSLv2:-LOW:-EXPORT:RC4+RSA',
    vhost_cfg_append => {
      'passenger_enabled'         => 'on',
      'passenger_ruby'            => '/usr/bin/ruby',
      'ssl_crl'                   => '/var/lib/puppet/ssl/ca/ca_crl.pem',
      'ssl_client_certificate'    => '/var/lib/puppet/ssl/certs/ca.pem',
      'ssl_verify_client'         => 'optional',
      'ssl_verify_depth'          => 1,
    },
    www_root    => '/etc/puppet/rack/public',
    use_default_location => false,
    access_log  => '/var/log/nginx/puppet_access.log',
    error_log   => '/var/log/nginx/puppet_error.log',
    passenger_cgi_param => {
      'SSL_CLIENT_S_DN'   => '$ssl_client_s_dn',
      'SSL_CLIENT_VERIFY' => '$ssl_client_verify',
    },
  }

}
}
'passenger': {
if !defined( Package['apt-transport-https'] ) { package { 'apt-transport-https': ensure => present } }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a fan of this pattern. What about ensure_resource?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I found this approach when I was trying to avoid duplicate resource declaration. ensure_resource is definitely more elegant.

@deric
Copy link
Contributor Author

deric commented Oct 7, 2013

Should be fixed, thanks for comments. Any other suggestions?

jfryman pushed a commit that referenced this pull request Oct 7, 2013
support for nginx passenger debian repositories
@jfryman jfryman merged commit c314aa6 into voxpupuli:master Oct 7, 2013
@jfryman
Copy link
Contributor

jfryman commented Oct 7, 2013

Nope, looks good. Thanks!

antevens pushed a commit to antevens/puppet-nginx that referenced this pull request Dec 13, 2013
Revert "Merge pull request voxpupuli#145 from deric/master"

This reverts commit c314aa6, reversing
changes made to 315d7e1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants