Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescarr committed Jul 18, 2012
0 parents commit 4391224
Show file tree
Hide file tree
Showing 348 changed files with 16,113 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vagrant
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"active":{"default":"e781cccf-2789-406c-9d0e-0d2ff414cec8"}}
15 changes: 15 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant::Config.run do |config|
config.vm.box = "lucid32"
config.vm.box_url = "http://files.vagrantup.com/lucid32.box"

config.vm.provision :puppet do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "default.pp"
puppet.module_path = "modules"
end

config.vm.network :hostonly, "192.168.50.4"
end
6 changes: 6 additions & 0 deletions local_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

echo 'ADDING host entry my.example.com to /etc/hosts'

echo '192.168.50.4 my.example.com' >> /etc/hosts

71 changes: 71 additions & 0 deletions manifests/default.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import 'mysql'
import 'apache'

node default {
include users
include db
include apache_server

exec {"apt-update":
command => "apt-get update",
path => "/usr/bin"
}

package{ "make":
ensure => present,
}
package{ "ruby-shadow":
ensure => present,
provider => gem
}
package{ "vim":
ensure => present
}
package {"git-core":
ensure => present
}

file { "/var/www":
owner => 'www-deploy',
group => 'www-data',
mode => 770,
recurse => true
}
}

class { 'mysql::server':
config_hash => { 'root_password' =>'foo'}
}

class { 'apache':
}
class { 'apache::php':
}
class apache_server {
apache::vhost { 'my.example.com':
priority => '10',
port => '80',
docroot => '/var/www/current/',
serveraliases => ['example.com',],
}
}
class db {
mysql::db { 'shipping':
user => 'myuser',
password => 'mypass',
host => 'localhost',
grant => ['all'],
}

}
class users {
user { 'www-deploy':
ensure => present,
password => '$6$5S4dhKry$kZBhdJHcGHrEdK.bnscoCi3owU4lxpuV9X.SSxlVj1cESKrXMPb9EKZn7me1ghuNMKYxZ2N7gNZeO0/sl79/p.',
groups => 'www-data',
managehome => true,
}


}

33 changes: 33 additions & 0 deletions modules/apache/CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
2012-05-08 Puppet Labs <info@puppetlabs.com> - 0.0.4
e62e362 Fix broken tests for ssl, vhost, vhost::*
42c6363 Changes to match style guide and pass puppet-lint without error
42bc8ba changed name => path for file resources in order to name namevar by it's name
72e13de One end too much
0739641 style guide fixes: 'true' <> true, $operatingsystem needs to be $::operatingsystem, etc.
273f94d fix tests
a35ede5 (#13860) Make a2enmod/a2dismo commands optional
98d774e (#13860) Autorequire Package['httpd']
05fcec5 (#13073) Add missing puppet spec tests
541afda (#6899) Remove virtual a2mod definition
976cb69 (#13072) Move mod python and wsgi package names to params
323915a (#13060) Add .gitignore to repo
fdf40af (#13060) Remove pkg directory from source tree
fd90015 Add LICENSE file and update the ModuleFile
d3d0d23 Re-enable local php class
d7516c7 Make management of firewalls configurable for vhosts
60f83ba Explicitly lookup scope of apache_name in templates.
f4d287f (#12581) Add explicit ordering for vdir directory
88a2ac6 (#11706) puppetlabs-apache depends on puppetlabs-firewall
a776a8b (#11071) Fix to work with latest firewall module
2b79e8b (#11070) Add support for Scientific Linux
405b3e9 Fix for a2mod
57b9048 Commit apache::vhost::redirect Manifest
8862d01 Commit apache::vhost::proxy Manifest
d5c1fd0 Commit apache::mod::wsgi Manifest
a825ac7 Commit apache::mod::python Manifest
b77062f Commit Templates
9a51b4a Vhost File Declarations
6cf7312 Defaults for Parameters
6a5b11a Ensure installed
f672e46 a2mod fix
8a56ee9 add pthon support to apache
15 changes: 15 additions & 0 deletions modules/apache/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Copyright (C) 2012 Puppet Labs Inc

Puppet Labs can be contacted at: info@puppetlabs.com

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
11 changes: 11 additions & 0 deletions modules/apache/Modulefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name 'puppetlabs-apache'
version '0.0.4'
source 'git://github.com/puppetlabs/puppetlabs-apache.git'
author 'puppetlabs'
license 'Apache 2.0'
summary 'Puppet module for Apache'
description 'Module for Apache configuration'
project_page 'https://github.com/puppetlabs/puppetlabs-apache'

## Add dependencies, if any:
dependency 'puppetlabs/firewall', '>= 0.0.4'
14 changes: 14 additions & 0 deletions modules/apache/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'rake'

task :default => [:spec]

desc "Run all module spec tests (Requires rspec-puppet gem)"
task :spec do
system("rspec spec")
end

desc "Build package"
task :build do
system("puppet-module build")
end

24 changes: 24 additions & 0 deletions modules/apache/files/httpd
Original file line number Diff line number Diff line change
@@ -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`
21 changes: 21 additions & 0 deletions modules/apache/lib/puppet/provider/a2mod/a2mod.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Puppet::Type.type(:a2mod).provide(:a2mod) do
desc "Manage Apache 2 modules on Debian and Ubuntu"

optional_commands :encmd => "a2enmod"
optional_commands :discmd => "a2dismod"

defaultfor :operatingsystem => [:debian, :ubuntu]

def create
encmd resource[:name]
end

def destroy
discmd resource[:name]
end

def exists?
mod= "/etc/apache2/mods-enabled/" + resource[:name] + ".load"
File.exists?(mod)
end
end
12 changes: 12 additions & 0 deletions modules/apache/lib/puppet/provider/a2mod/modfix.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Puppet::Type.type(:a2mod).provide :modfix do
desc "Dummy provider for A2mod.
Fake nil resources when there is no crontab binary available. Allows
puppetd to run on a bootstrapped machine before a Cron package has been
installed. Workaround for: http://projects.puppetlabs.com/issues/2384
"

def self.instances
[]
end
end
15 changes: 15 additions & 0 deletions modules/apache/lib/puppet/type/a2mod.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Puppet::Type.newtype(:a2mod) do
@doc = "Manage Apache 2 modules on Debian and Ubuntu"

ensurable

newparam(:name) do
desc "The name of the module to be managed"

isnamevar

end

autorequire(:package) { catalog.resource(:package, 'httpd')}

end
21 changes: 21 additions & 0 deletions modules/apache/manifests/dev.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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_dev_package':
ensure => installed,
name => $apache::params::apache_dev,
}
}
38 changes: 38 additions & 0 deletions modules/apache/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Class: apache
#
# This class installs Apache
#
# Parameters:
#
# Actions:
# - Install Apache
# - Manage Apache service
#
# Requires:
#
# Sample Usage:
#
class apache {
include apache::params

package { 'httpd':
ensure => installed,
name => $apache::params::apache_name,
}

service { 'httpd':
ensure => running,
name => $apache::params::apache_name,
enable => true,
subscribe => Package['httpd'],
}

file { 'httpd_vdir':
ensure => directory,
path => $apache::params::vdir,
recurse => true,
purge => true,
notify => Service['httpd'],
require => Package['httpd'],
}
}
14 changes: 14 additions & 0 deletions modules/apache/manifests/mod/python.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class apache::mod::python {
include apache

package { 'mod_python_package':
ensure => installed,
name => $apache::params::mod_python_package,
require => Package['httpd'];
}

a2mod { 'python': ensure => present; }

}


13 changes: 13 additions & 0 deletions modules/apache/manifests/mod/wsgi.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class apache::mod::wsgi {
include apache

package { 'mod_wsgi_package':
ensure => installed,
name => $apache::params::mod_wsgi_package,
require => Package['httpd'];
}

a2mod { 'wsgi': ensure => present; }

}

Loading

0 comments on commit 4391224

Please sign in to comment.