diff options
author | Micah <micah@leap.se> | 2016-07-12 16:46:06 -0400 |
---|---|---|
committer | Micah <micah@leap.se> | 2016-07-12 16:46:06 -0400 |
commit | 4a11e48e397f1a7eb4c68a1dd1f9e3c5a11352f8 (patch) | |
tree | 66379b593391e99bb5dc66cf7e9ef48947d80a21 /puppet/modules/passenger/manifests | |
parent | 95d95925e53ec98f3f5868479328a69449de3ca7 (diff) |
git subrepo clone https://leap.se/git/puppet_passenger puppet/modules/passenger
subrepo:
subdir: "puppet/modules/passenger"
merged: "47fca11"
upstream:
origin: "https://leap.se/git/puppet_passenger"
branch: "master"
commit: "47fca11"
git-subrepo:
version: "0.3.0"
origin: "https://github.com/ingydotnet/git-subrepo"
commit: "1e79595"
Change-Id: Idba1129126ca0f13a4441e00d7b53e8b4f856825
Diffstat (limited to 'puppet/modules/passenger/manifests')
-rw-r--r-- | puppet/modules/passenger/manifests/apache.pp | 7 | ||||
-rw-r--r-- | puppet/modules/passenger/manifests/apache/base.pp | 4 | ||||
-rw-r--r-- | puppet/modules/passenger/manifests/apache/centos.pp | 24 | ||||
-rw-r--r-- | puppet/modules/passenger/manifests/apache/debian.pp | 24 | ||||
-rw-r--r-- | puppet/modules/passenger/manifests/init.pp | 75 | ||||
-rw-r--r-- | puppet/modules/passenger/manifests/munin.pp | 20 |
6 files changed, 154 insertions, 0 deletions
diff --git a/puppet/modules/passenger/manifests/apache.pp b/puppet/modules/passenger/manifests/apache.pp new file mode 100644 index 00000000..d4181ffe --- /dev/null +++ b/puppet/modules/passenger/manifests/apache.pp @@ -0,0 +1,7 @@ +class passenger::apache{ + case $operatingsystem { + centos: { include passenger::apache::centos } + debian: { include passenger::apache::debian } + defaults: { include passenger::apache::base } + } +} diff --git a/puppet/modules/passenger/manifests/apache/base.pp b/puppet/modules/passenger/manifests/apache/base.pp new file mode 100644 index 00000000..441c9bd5 --- /dev/null +++ b/puppet/modules/passenger/manifests/apache/base.pp @@ -0,0 +1,4 @@ +class passenger::apache::base { + # Todo ! + include apache +} diff --git a/puppet/modules/passenger/manifests/apache/centos.pp b/puppet/modules/passenger/manifests/apache/centos.pp new file mode 100644 index 00000000..b7b80e3b --- /dev/null +++ b/puppet/modules/passenger/manifests/apache/centos.pp @@ -0,0 +1,24 @@ +class passenger::apache::centos inherits passenger::apache::base { + + package { 'mod_passenger': + ensure => installed, + require => Package['apache'], + } + + file { '/var/www/passenger_buffer': + ensure => directory, + require => [ Package['apache'], Package['mod_passenger'] ], + owner => apache, + group => 0, + mode => '0600'; + } + + file{ '/etc/httpd/conf.d/mod_passenger_custom.conf': + content => "PassengerUploadBufferDir /var/www/passenger_buffer\n", + require => File['/var/www/passenger_buffer'], + notify => Service['apache'], + owner => root, + group => 0, + mode => '0644'; + } +} diff --git a/puppet/modules/passenger/manifests/apache/debian.pp b/puppet/modules/passenger/manifests/apache/debian.pp new file mode 100644 index 00000000..38eb3fa4 --- /dev/null +++ b/puppet/modules/passenger/manifests/apache/debian.pp @@ -0,0 +1,24 @@ +class passenger::apache::debian inherits passenger::apache::base { + + package { 'libapache2-mod-passenger': + ensure => installed, + require => Package['apache2'], + } + + file { '/var/www/passenger_buffer': + ensure => directory, + require => [ Package['apache2'], Package['libapache2-mod-passenger'] ], + owner => www-data, + group => 0, + mode => '0600'; + } + + file { '/etc/apache2/conf.d/mod_passenger_custom.conf': + content => "PassengerUploadBufferDir /var/www/passenger_buffer\n", + require => File['/var/www/passenger_buffer'], + notify => Service['apache2'], + owner => root, + group => 0, + mode => '0644'; + } +} diff --git a/puppet/modules/passenger/manifests/init.pp b/puppet/modules/passenger/manifests/init.pp new file mode 100644 index 00000000..ed9b8c31 --- /dev/null +++ b/puppet/modules/passenger/manifests/init.pp @@ -0,0 +1,75 @@ +# passenger module +# +# Copyright 2010, Riseup Networks +# Micah Anderson micah(at)riseup.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3 as +# published by the Free Software Foundation. + +class passenger ( + $use_gems = false, $manage_munin = false, + $passenger_ensure_version = 'installed', + $librack_ensure_version = 'installed', + $passenger_bin_path = '/usr/sbin' ) +{ + Class['::apache'] -> Class['passenger'] + + if ! $use_gems { + + apache::module { 'passenger': + ensure => $passenger_ensure_version, + package_name => 'libapache2-mod-passenger'; + } + + if !defined(Package['librack-ruby']) { + if $::lsbdistcodename == 'squeeze' { + package { 'librack-ruby1.8': ensure => $librack_ensure_version } + } + else { + package { 'ruby-rack': + ensure => $librack_ensure_version; + } + } + } + } + else { + package { + 'passenger': + ensure => $passenger_ensure_version, + provider => gem; + 'rack': + ensure => $librack_ensure_version, + provider => gem; + } + } + + apache::config::file { 'mod_passenger': + ensure => present, + source => [ "puppet:///modules/site_passenger/${::fqdn}/mod_passenger.conf", + 'puppet:///modules/site_passenger/mod_passenger.conf', + 'puppet:///modules/passenger/mod_passenger.conf', + ], + } + + if $manage_munin { + if $passenger_memory_munin_config == '' { + $passenger_memory_munin_config = "user root\nenv.passenger_memory_stats ${passenger_bin_path}/passenger-memory-stats" + } + + if $passenger_stats_munin_config == '' { + $passenger_stats_munin_config = "user root\nenv.passenger_status ${passenger_bin_path}/passenger-status" + } + + munin::plugin::deploy { + 'passenger_memory_stats': + source => 'passenger/munin/passenger_memory_stats', + config => $passenger_memory_munin_config; + 'passenger_stats': + source => 'passenger/munin/passenger_stats', + config => $passenger_stats_munin_config; + } + } + +} + diff --git a/puppet/modules/passenger/manifests/munin.pp b/puppet/modules/passenger/manifests/munin.pp new file mode 100644 index 00000000..36bc53f2 --- /dev/null +++ b/puppet/modules/passenger/manifests/munin.pp @@ -0,0 +1,20 @@ +class passenger::munin { + + case $passenger_memory_munin_config { '': + { $passenger_memory_munin_config = "user root\nenv.passenger_memory_stats /usr/sbin/passenger-memory-stats" } + } + + case $passenger_stats_munin_config { '': + { $passenger_stats_munin_config = "user root\n" } + } + + munin::plugin::deploy { + 'passenger_memory_stats': + source => 'passenger/munin/passenger_memory_stats', + config => $passenger_memory_munin_config; + 'passenger_stats': + source => 'passenger/munin/passenger_stats', + config => $passenger_stats_munin_config; + } + +} |