Permalink
Browse files

Reboot fork from puppetlabs/puppet-apache

  • Loading branch information...
ceefour committed Mar 5, 2012
0 parents commit ed2a7c250dcd038c4f570cfb2d104668182710bc
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>puppet-apache</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.cloudsmith.geppetto.pp.dsl.ui.modulefileBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.cloudsmith.geppetto.pp.dsl.ui.puppetNature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,6 @@
+name 'soluvas-apache'
+version '0.0.3.1'
+
+author ''
+license ''
+dependency 'puppetlabs-firewall', '>=0.0.1'
@@ -0,0 +1,25 @@
+h1. apache Puppet Module
+
+Based on "puppetlabs-apache":https://github.com/puppetlabs/puppetlabs-apache (C) PuppetLabs.
+
+h2. Common Usage
+
+bc. include apache
+# Realize previously defined virtual resources of Apache modules
+Apache::Module <| |>
+
+h2. Development Usage
+
+Add class @apache::dev@ :
+
+bc. include apache::dev
+
+h2. Apache Modules Management
+
+Example:
+
+bc. @apache::module {
+ 'fastcgi' : ensure => present;
+ 'proxy_http': ensure => present;
+ 'status': ensure => absent;
+}
@@ -0,0 +1,24 @@
+# Configuration file for the httpd service.
+
+#
+# The default processing model (MPM) is the process-based
+# 'prefork' model. A thread-based model, 'worker', is also
+# available, but does not work with some modules (such as PHP).
+# The service must be stopped before changing this variable.
+#
+#HTTPD=/usr/sbin/httpd.worker
+
+#
+# To pass additional options (for instance, -D definitions) to the
+# httpd binary at startup, set OPTIONS here.
+#
+#OPTIONS=
+#OPTIONS=-DDOWN
+
+#
+# By default, the httpd process is started in the C locale; to
+# change the locale in which the server runs, the HTTPD_LANG
+# variable can be set.
+#
+#HTTPD_LANG=C
+export SHORTHOST=`hostname -s`
@@ -0,0 +1,18 @@
+#
+# Test vhost
+#
+NameVirtualHost *:80
+<VirtualHost *:80>
+ ServerName testvhost
+ DocumentRoot /tmp/testvhost
+ <Directory /tmp/testvhost>
+ Options Indexes FollowSymLinks MultiViews
+ AllowOverride None
+ Order allow,deny
+ allow from all
+ </Directory>
+ ErrorLog /var/log/apache2/error.log
+ LogLevel warn
+ CustomLog /var/log/apache2/access.log combined
+ ServerSignature On
+</VirtualHost>
@@ -0,0 +1,18 @@
+# Class: apache::dev
+#
+# This class installs Apache development libraries
+#
+# Parameters:
+#
+# Actions:
+# - Install Apache development libraries
+#
+# Requires:
+#
+# Sample Usage:
+#
+class apache::dev {
+ include apache::params
+
+ package{$apache::params::apache_dev: ensure => installed}
+}
@@ -0,0 +1,57 @@
+# Class: apache
+#
+# This class installs Apache
+#
+# Parameters:
+#
+# Actions:
+# - Install Apache
+# - Manage Apache service
+#
+# Requires:
+#
+# Sample Usage:
+#
+class apache {
+ include apache::params
+ package { 'httpd':
+ name => $apache::params::apache_name,
+ ensure => installed,
+ }
+ service { 'httpd':
+ name => $apache::params::apache_name,
+ ensure => running,
+ enable => true,
+ subscribe => Package['httpd'],
+ }
+
+ # ASK: May want to purge all not realized modules using the resources resource type?
+ define module($ensure = 'present') {
+ case $ensure {
+ 'present': {
+ exec { "/usr/sbin/a2enmod $name":
+ unless => "/usr/bin/test -e /etc/apache2/mods-enabled/$name.load",
+ require => Package['httpd'],
+ notify => Service['httpd']
+ }
+ }
+ 'absent': {
+ exec { "/usr/sbin/a2dismod $name":
+ onlyif => "/usr/bin/test -e /etc/apache2/mods-enabled/$name.load",
+ require => Package['httpd'],
+ notify => Service['httpd']
+ }
+ }
+ }
+ }
+ @module {
+ ['rewrite', 'headers', 'expires', 'deflate']: ensure => present;
+ }
+
+ file { $apache::params::vdir:
+ ensure => directory,
+ recurse => true,
+ purge => true,
+ notify => Service['httpd'],
+ }
+}
@@ -0,0 +1,17 @@
+class apache::mod::python {
+ include apache
+
+ package { "python":
+ name => $operatingsystem ? {
+ 'centos', 'fedora', 'redhat', 'scientific' => "mod_python",
+ default => "libapache2-mod-python",
+ },
+ ensure => installed,
+ require => Package["httpd"];
+ }
+
+ a2mod { "python": ensure => present; }
+
+}
+
+
@@ -0,0 +1,16 @@
+class apache::mod::wsgi {
+ include apache
+
+ package { "wsgi":
+ name => $operatingsystem ? {
+ 'centos', 'fedora', 'redhat', 'scientific' => "mod_wsgi",
+ default => "libapache2-mod-wsgi",
+ },
+ ensure => installed,
+ require => Package["httpd"];
+ }
+
+ a2mod { "wsgi": ensure => present; }
+
+}
+
@@ -0,0 +1,56 @@
+# Class: apache::params
+#
+# This class manages Apache parameters
+#
+# Parameters:
+# - The $user that Apache runs as
+# - The $group that Apache runs as
+# - The $apache_name is the name of the package and service on the relevant distribution
+# - The $php_package is the name of the package that provided PHP
+# - The $ssl_package is the name of the Apache SSL package
+# - The $apache_dev is the name of the Apache development libraries package
+#
+# Actions:
+#
+# Requires:
+#
+# Sample Usage:
+#
+class apache::params {
+
+ $user = 'www-data'
+ $group = 'www-data'
+ $ssl = 'true'
+ $template = 'apache/vhost-default.conf.erb'
+ $priority = '25'
+ $servername = ''
+ $serveraliases = ''
+ $auth = false
+ $redirect_ssl = false
+ $options = 'Indexes FollowSymLinks MultiViews'
+ $vhost_name = '*'
+
+ case $operatingsystem {
+ 'centos', 'redhat', 'fedora', 'scientific': {
+ $apache_name = 'httpd'
+ $php_package = 'php'
+ $ssl_package = 'mod_ssl'
+ $apache_dev = 'httpd-devel'
+ $vdir = '/etc/httpd/conf.d/'
+ }
+ 'ubuntu', 'debian': {
+ $apache_name = 'apache2'
+ $php_package = 'libapache2-mod-php5'
+ $ssl_package = 'apache-ssl'
+ $apache_dev = [ 'libaprutil1-dev', 'libapr1-dev', 'apache2-prefork-dev' ]
+ $vdir = '/etc/apache2/sites-enabled/'
+ }
+ default: {
+ $apache_name = 'apache2'
+ $php_package = 'libapache2-mod-php5'
+ $ssl_package = 'apache-ssl'
+ $apache_dev = 'apache-dev'
+ $vdir = '/etc/apache2/sites-enabled/'
+ }
+ }
+}
@@ -0,0 +1,22 @@
+# Class: apache::php
+#
+# This class installs PHP for Apache
+#
+# Parameters:
+# - $php_package
+#
+# Actions:
+# - Install Apache mod_php5 package
+#
+# Requires:
+#
+# Sample Usage:
+#
+class apache::php {
+ include php
+# include apache::params
+
+# package { $apache::params::php_package:
+# ensure => present,
+# }
+}
@@ -0,0 +1,24 @@
+# Class: apache::python
+#
+# This class installs Python for Apache
+#
+# Parameters:
+# - $php_package
+#
+# Actions:
+# - Install Apache Python package
+#
+# Requires:
+#
+# Sample Usage:
+#
+class apache::python {
+ include apache::params
+ include apache
+
+ package { $apache::params::python_package:
+ ensure => present,
+ }
+ a2mod { "python": ensure => present, }
+
+}
@@ -0,0 +1,29 @@
+# Class: apache::ssl
+#
+# This class installs Apache SSL capabilities
+#
+# Parameters:
+# - The $ssl_package name from the apache::params class
+#
+# Actions:
+# - Install Apache SSL capabilities
+#
+# Requires:
+#
+# Sample Usage:
+#
+class apache::ssl {
+
+ include apache
+
+ case $operatingsystem {
+ 'centos', 'fedora', 'redhat', 'scientific': {
+ package { $apache::params::ssl_package:
+ require => Package['httpd'],
+ }
+ }
+ 'ubuntu', 'debian': {
+ a2mod { "ssl": ensure => present, }
+ }
+ }
+}
Oops, something went wrong.

0 comments on commit ed2a7c2

Please sign in to comment.