provizioning 0.1.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/README.md +29 -0
- data/Rakefile +2 -0
- data/bootstrap/bootstrap.sh +71 -0
- data/{lib/templates/sources.list → bootstrap/lucid.sources.list} +2 -1
- data/bootstrap/natty.sources.list +14 -0
- data/lib/provizioning/puppet.rb +94 -0
- data/lib/provizioning/version.rb +3 -0
- data/lib/provizioning.rb +1 -3
- data/provizioning.gemspec +20 -0
- data/puppet/classes/apache/centos.conf +978 -0
- data/puppet/classes/apache/ssl.conf +75 -0
- data/puppet/classes/apache.pp +152 -0
- data/puppet/classes/apt.pp +5 -0
- data/puppet/classes/base/ntp/ntpd-sysconfig +13 -0
- data/puppet/classes/base.pp +79 -0
- data/puppet/classes/freerange.pp +53 -0
- data/puppet/classes/gemrc/gemrc +9 -0
- data/puppet/classes/gemrc.pp +10 -0
- data/puppet/classes/imagemagick.pp +19 -0
- data/puppet/classes/iptables/load-iptables +3 -0
- data/puppet/classes/iptables/post-iptables +2 -0
- data/puppet/classes/iptables/pre-iptables +2 -0
- data/puppet/classes/iptables.pp +59 -0
- data/puppet/classes/logrotate/logrotate.erb +15 -0
- data/puppet/classes/logrotate.pp +37 -0
- data/puppet/classes/mongo/mongodb.conf +89 -0
- data/puppet/classes/mongo.pp +86 -0
- data/puppet/classes/monit/monit.conf +242 -0
- data/puppet/classes/monit.pp +39 -0
- data/puppet/classes/munin/plugins/passenger_memory_stats +123 -0
- data/puppet/classes/munin/plugins/passenger_status +130 -0
- data/puppet/classes/munin/plugins/rails_database_time +174 -0
- data/puppet/classes/munin/plugins/rails_request_duration +173 -0
- data/puppet/classes/munin/plugins/rails_request_error +169 -0
- data/puppet/classes/munin/plugins/rails_requests +175 -0
- data/puppet/classes/munin/plugins/rails_view_render_time +173 -0
- data/puppet/classes/munin/rails-plugin-config +4 -0
- data/puppet/classes/munin.pp +60 -0
- data/puppet/classes/mysql/password.erb +1 -0
- data/puppet/classes/mysql.pp +71 -0
- data/puppet/classes/openswan/ipsec.conf +17 -0
- data/puppet/classes/openswan/ipsec.secrets +1 -0
- data/puppet/classes/openswan/patched_ipsec_initd_script +223 -0
- data/puppet/classes/openswan/secret.erb +1 -0
- data/puppet/classes/openswan.pp +71 -0
- data/puppet/classes/post-flight.pp +17 -0
- data/puppet/classes/postfix/main.cf +39 -0
- data/puppet/classes/postfix.pp +16 -0
- data/puppet/classes/rack/centos/passenger.load.erb +5 -0
- data/puppet/classes/rack/ubuntu/passenger.conf.erb +6 -0
- data/puppet/classes/rack.pp +66 -0
- data/puppet/classes/redis/redis.conf.erb +187 -0
- data/puppet/classes/redis.pp +20 -0
- data/puppet/classes/sudo/sudoers +6 -0
- data/puppet/classes/sudo.pp +24 -0
- data/puppet/classes/syslogng/CentOS.cnf +61 -0
- data/puppet/classes/syslogng/Ubuntu.cnf +347 -0
- data/puppet/classes/syslogng.pp +146 -0
- data/puppet/classes/xml.pp +23 -0
- data/puppet/classes/yum.pp +6 -0
- data/puppet/classes/zsh.pp +5 -0
- data/puppet/modules/README +74 -0
- data/puppet/modules/cron/README +4 -0
- data/puppet/modules/cron/manifests/base.pp +26 -0
- data/puppet/modules/cron/manifests/crontabs.pp +11 -0
- data/puppet/modules/cron/manifests/init.pp +18 -0
- data/puppet/modules/drupal/Modulefile +7 -0
- data/puppet/modules/drupal/README +110 -0
- data/puppet/modules/drupal/manifests/absent.pp +25 -0
- data/puppet/modules/drupal/manifests/backup/absent.pp +23 -0
- data/puppet/modules/drupal/manifests/backup.pp +49 -0
- data/puppet/modules/drupal/manifests/conf.pp +23 -0
- data/puppet/modules/drupal/manifests/debug.pp +26 -0
- data/puppet/modules/drupal/manifests/disable.pp +22 -0
- data/puppet/modules/drupal/manifests/disableboot.pp +13 -0
- data/puppet/modules/drupal/manifests/drush.pp +20 -0
- data/puppet/modules/drupal/manifests/example42/backup.pp +8 -0
- data/puppet/modules/drupal/manifests/example42/monitor.pp +8 -0
- data/puppet/modules/drupal/manifests/example42.pp +25 -0
- data/puppet/modules/drupal/manifests/extra.pp +30 -0
- data/puppet/modules/drupal/manifests/firewall/absent.pp +19 -0
- data/puppet/modules/drupal/manifests/firewall.pp +24 -0
- data/puppet/modules/drupal/manifests/init.pp +54 -0
- data/puppet/modules/drupal/manifests/install.pp +20 -0
- data/puppet/modules/drupal/manifests/module.pp +37 -0
- data/puppet/modules/drupal/manifests/monitor/absent.pp +42 -0
- data/puppet/modules/drupal/manifests/monitor.pp +77 -0
- data/puppet/modules/drupal/manifests/package.pp +20 -0
- data/puppet/modules/drupal/manifests/params.pp +277 -0
- data/puppet/modules/drupal/manifests/site.pp +63 -0
- data/puppet/modules/drupal/manifests/theme.pp +33 -0
- data/puppet/modules/drupal/templates/variables_drupal.erb +62 -0
- data/puppet/modules/drupal/tests/absent.pp +1 -0
- data/puppet/modules/drupal/tests/backup.pp +1 -0
- data/puppet/modules/drupal/tests/debug.pp +1 -0
- data/puppet/modules/drupal/tests/disable.pp +1 -0
- data/puppet/modules/drupal/tests/disableboot.pp +1 -0
- data/puppet/modules/drupal/tests/firewall.pp +1 -0
- data/puppet/modules/drupal/tests/init.pp +1 -0
- data/puppet/modules/drupal/tests/monitor.pp +1 -0
- data/puppet/modules/hosts/README +0 -0
- data/puppet/modules/hosts/manifests/example42.pp +5 -0
- data/puppet/modules/hosts/manifests/init.pp +16 -0
- data/puppet/modules/hosts/templates/hosts.erb +11 -0
- data/puppet/modules/iptables/README +4 -0
- data/puppet/modules/iptables/files/iptables +19 -0
- data/puppet/modules/iptables/manifests/disable.pp +15 -0
- data/puppet/modules/iptables/manifests/init.pp +9 -0
- data/puppet/modules/iptables/manifests/redhat.pp +24 -0
- data/puppet/modules/mysql/Modulefile +7 -0
- data/puppet/modules/mysql/README +56 -0
- data/puppet/modules/mysql/manifests/absent.pp +12 -0
- data/puppet/modules/mysql/manifests/backup/example42.pp +8 -0
- data/puppet/modules/mysql/manifests/backup.pp +49 -0
- data/puppet/modules/mysql/manifests/client.pp +18 -0
- data/puppet/modules/mysql/manifests/conf.pp +23 -0
- data/puppet/modules/mysql/manifests/debug.pp +25 -0
- data/puppet/modules/mysql/manifests/disable.pp +13 -0
- data/puppet/modules/mysql/manifests/disableboot.pp +13 -0
- data/puppet/modules/mysql/manifests/example42.pp +25 -0
- data/puppet/modules/mysql/manifests/firewall.pp +23 -0
- data/puppet/modules/mysql/manifests/grant.pp +29 -0
- data/puppet/modules/mysql/manifests/init.pp +67 -0
- data/puppet/modules/mysql/manifests/monitor/example42.pp +8 -0
- data/puppet/modules/mysql/manifests/monitor.pp +77 -0
- data/puppet/modules/mysql/manifests/params.pp +240 -0
- data/puppet/modules/mysql/manifests/query.pp +30 -0
- data/puppet/modules/mysql/templates/grant.erb +6 -0
- data/puppet/modules/mysql/templates/query.erb +5 -0
- data/puppet/modules/mysql/templates/variables_mysql.erb +42 -0
- data/puppet/modules/network/README +4 -0
- data/puppet/modules/network/manifests/init.pp +13 -0
- data/puppet/modules/nginx/manifests/fcgi.pp +87 -0
- data/puppet/modules/nginx/manifests/init.pp +205 -0
- data/puppet/modules/nginx/templates/fcgi_site.erb +38 -0
- data/puppet/modules/nginx/templates/includes/fastcgi_params.erb +23 -0
- data/puppet/modules/nginx/templates/nginx.conf.erb +31 -0
- data/puppet/modules/passenger/manifests/init.pp +12 -0
- data/puppet/modules/passenger/templates/myapp +39 -0
- data/puppet/modules/php/README +26 -0
- data/puppet/modules/php/manifests/init.pp +42 -0
- data/puppet/modules/php/manifests/module.pp +22 -0
- data/puppet/modules/php/manifests/pear/module.pp +21 -0
- data/puppet/modules/php/manifests/pear.pp +20 -0
- data/puppet/modules/php/manifests/pecl/config.pp +19 -0
- data/puppet/modules/php/manifests/pecl/module.pp +44 -0
- data/puppet/modules/php/manifests/pecl.pp +8 -0
- data/puppet/modules/php/manifests/soap.pp +20 -0
- data/puppet/modules/postgres/Copyright +13 -0
- data/puppet/modules/postgres/manifests/database.pp +40 -0
- data/puppet/modules/postgres/manifests/init.pp +25 -0
- data/puppet/modules/postgres/manifests/role.pp +40 -0
- data/puppet/modules/ruby/files/install-ruby-stow +43 -0
- data/puppet/modules/ruby/manifests/init.pp +18 -0
- data/puppet/modules/rvm/files/install-system-rvm +2 -0
- data/puppet/modules/rvm/manifests/classes/dependencies.pp +24 -0
- data/puppet/modules/rvm/manifests/classes/passenger.pp +166 -0
- data/puppet/modules/rvm/manifests/classes/system.pp +33 -0
- data/puppet/modules/rvm/manifests/definitions/system_user.pp +13 -0
- data/puppet/modules/rvm/manifests/init.pp +2 -0
- data/puppet/modules/rvm/templates/passenger-apache.conf.erb +9 -0
- data/puppet/modules/ssh/README +4 -0
- data/puppet/modules/ssh/manifests/auth.pp +39 -0
- data/puppet/modules/ssh/manifests/auth.pp.good +340 -0
- data/puppet/modules/ssh/manifests/eal4.pp +69 -0
- data/puppet/modules/ssh/manifests/init.pp +74 -0
- data/puppet/modules/stow/manifests/init.pp +5 -0
- data/puppet/modules/sudo/files/sudoers +25 -0
- data/puppet/modules/sudo/manifests/init.pp +1 -0
- data/puppet/modules/sudo/manifests/install.pp +5 -0
- data/puppet/modules/sudo/manifests/sudoers.pp +14 -0
- data/puppet/modules/ufw/manifests/init.pp +12 -0
- data/puppet/modules/users/README +28 -0
- data/puppet/modules/users/manifests/adduser.pp +16 -0
- data/puppet/modules/users/manifests/admin.pp +11 -0
- data/puppet/modules/users/manifests/automount.pp +34 -0
- data/puppet/modules/users/manifests/deluser.pp +8 -0
- data/puppet/modules/users/manifests/example42.pp +16 -0
- data/puppet/modules/users/manifests/init.pp +31 -0
- data/puppet/modules/users/manifests/ldap.pp +114 -0
- data/puppet/modules/users/manifests/params.pp +84 -0
- data/puppet/modules/users/templates/ldap/ldap.conf.erb +13 -0
- data/puppet/modules/users/templates/ldap/nsswitch.conf.erb +23 -0
- data/puppet/modules/users/templates/ldap/openldap-ldap.conf.erb +8 -0
- data/puppet/modules/webmin/manifests/init.pp +31 -0
- data/puppet/roles/blank.pp +1 -0
- data/puppet/site.pp +8 -0
- metadata +235 -81
- data/README +0 -3
- data/bin/provizion +0 -52
- data/lib/policies/chef-client.rb +0 -37
- data/lib/policies/lamp.rb +0 -42
- data/lib/policies/passenger.rb +0 -44
- data/lib/recipes/apache.rb +0 -70
- data/lib/recipes/apache_conf.rb +0 -3
- data/lib/recipes/bundler.rb +0 -4
- data/lib/recipes/chef_client.rb +0 -11
- data/lib/recipes/curl.rb +0 -8
- data/lib/recipes/essential.rb +0 -4
- data/lib/recipes/git.rb +0 -15
- data/lib/recipes/imagemagick.rb +0 -8
- data/lib/recipes/mailserver.rb +0 -9
- data/lib/recipes/memcached.rb +0 -16
- data/lib/recipes/mysql.rb +0 -21
- data/lib/recipes/nginx/init.d +0 -63
- data/lib/recipes/nginx.rb +0 -25
- data/lib/recipes/passenger.rb +0 -67
- data/lib/recipes/php.rb +0 -8
- data/lib/recipes/postgresql.rb +0 -21
- data/lib/recipes/ruby_enterprise.rb +0 -24
- data/lib/recipes/rvm.rb +0 -25
- data/lib/recipes/sources.rb +0 -5
- data/lib/recipes/subversion.rb +0 -8
- data/lib/recipes/syslog.rb +0 -7
- data/lib/recipes/ufw.rb +0 -12
- data/lib/recipes/vim.rb +0 -8
- data/lib/recipes/webmin.rb +0 -17
- data/lib/templates/apache.conf.erb +0 -12
- data/lib/templates/my.cnf +0 -132
- data/lib/templates/passenger.conf +0 -11
- data/lib/templates/passenger.load +0 -1
@@ -0,0 +1,23 @@
|
|
1
|
+
fastcgi_param QUERY_STRING $query_string;
|
2
|
+
fastcgi_param REQUEST_METHOD $request_method;
|
3
|
+
fastcgi_param CONTENT_TYPE $content_type;
|
4
|
+
fastcgi_param CONTENT_LENGTH $content_length;
|
5
|
+
|
6
|
+
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
7
|
+
fastcgi_param REQUEST_URI $request_uri;
|
8
|
+
fastcgi_param DOCUMENT_URI $document_uri;
|
9
|
+
fastcgi_param DOCUMENT_ROOT $document_root;
|
10
|
+
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
11
|
+
|
12
|
+
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
|
13
|
+
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
14
|
+
|
15
|
+
fastcgi_param REMOTE_ADDR $remote_addr;
|
16
|
+
fastcgi_param REMOTE_PORT $remote_port;
|
17
|
+
fastcgi_param SERVER_ADDR $server_addr;
|
18
|
+
fastcgi_param SERVER_PORT $server_port;
|
19
|
+
fastcgi_param SERVER_NAME $server_name;
|
20
|
+
|
21
|
+
# PHP only, required if PHP was built with --enable-force-cgi-redirect
|
22
|
+
fastcgi_param REDIRECT_STATUS 200;
|
23
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
user <%= real_nginx_user %>;
|
2
|
+
worker_processes <%= real_nginx_worker_processes %>;
|
3
|
+
|
4
|
+
error_log /var/log/nginx/error.log;
|
5
|
+
pid /var/run/nginx.pid;
|
6
|
+
|
7
|
+
events {
|
8
|
+
worker_connections <%= real_nginx_worker_connections %>;
|
9
|
+
# multi_accept on;
|
10
|
+
}
|
11
|
+
|
12
|
+
http {
|
13
|
+
include /etc/nginx/mime.types;
|
14
|
+
|
15
|
+
access_log /var/log/nginx/access.log;
|
16
|
+
|
17
|
+
sendfile on;
|
18
|
+
#tcp_nopush on;
|
19
|
+
|
20
|
+
#keepalive_timeout 0;
|
21
|
+
keepalive_timeout 65;
|
22
|
+
tcp_nodelay on;
|
23
|
+
|
24
|
+
gzip on;
|
25
|
+
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
|
26
|
+
|
27
|
+
include /etc/nginx/conf.d/*.conf;
|
28
|
+
include /etc/nginx/sites-enabled/*;
|
29
|
+
|
30
|
+
server_tokens off;
|
31
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class passenger($ruby_version = 'ruby-1.9.3-p0') {
|
2
|
+
exec { "passenger-gem":
|
3
|
+
command => "/usr/local/bin/gem install passenger --no-ri --no-rdoc",
|
4
|
+
creates => "/usr/local/stow/${ruby_version}/bin",
|
5
|
+
require => [Package["stow"], Exec["ruby-stow"]];
|
6
|
+
}
|
7
|
+
|
8
|
+
exec { "restow":
|
9
|
+
command => "/usr/bin/stow -d /usr/local/stow ${ruby_version}",
|
10
|
+
require => Exec["passenger-gem"];
|
11
|
+
}
|
12
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
### BEGIN INIT INFO
|
3
|
+
# Provides: myapp passenger in standalone
|
4
|
+
# Default-Start: 2 3 4 5
|
5
|
+
# Default-Stop: 0 1 6
|
6
|
+
# X-Interactive: true
|
7
|
+
# Short-Description: Start/stop de-fra.com web site
|
8
|
+
### END INIT INFO
|
9
|
+
|
10
|
+
#PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
11
|
+
GEM_HOME=/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1
|
12
|
+
PASSENGER=/usr/local/bin/passenger
|
13
|
+
PORT=80
|
14
|
+
ENVIRONMENT=production
|
15
|
+
APP="/var/www/myapp/current"
|
16
|
+
USER=deploy
|
17
|
+
RUBY_VERSION=1.9.2
|
18
|
+
USER=deploy
|
19
|
+
SET_PATH="cd $APP; export GEM_HOME=$GEM_HOME"
|
20
|
+
CMD="$SET_PATH; $PASSENGER start -p $PORT -e $ENVIRONMENT -d"
|
21
|
+
|
22
|
+
. /lib/lsb/init-functions
|
23
|
+
|
24
|
+
case "$1" in
|
25
|
+
start)
|
26
|
+
echo "Starting myapp passenger"
|
27
|
+
echo $CMD
|
28
|
+
su - $USER -c "$CMD"
|
29
|
+
;;
|
30
|
+
stop)
|
31
|
+
echo "Stopping myapp passenger"
|
32
|
+
cd $APP
|
33
|
+
$PASSENGER stop -p $PORT
|
34
|
+
;;
|
35
|
+
*)
|
36
|
+
echo "Usage: $0 start|stop" >&2
|
37
|
+
exit 3
|
38
|
+
;;
|
39
|
+
esac
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Puppet module: php
|
2
|
+
|
3
|
+
# Written by Lab42 #
|
4
|
+
# http://www.example42.com
|
5
|
+
|
6
|
+
Licence: GPLv3
|
7
|
+
|
8
|
+
|
9
|
+
DESCRIPTION:
|
10
|
+
This module installs php and provides custom defines to manage php modules, pear components and pecl extensions
|
11
|
+
|
12
|
+
USAGE:
|
13
|
+
include php # Installs php
|
14
|
+
include php::pear # Installs pear support
|
15
|
+
include php::dev # Installs php-dev
|
16
|
+
#TODO include php::absent # Remove php package.
|
17
|
+
|
18
|
+
php::module { mysql: } # Installs specific module for php
|
19
|
+
|
20
|
+
php::pear::module { Crypt-CHAP: } # Installs pear component using OS package
|
21
|
+
php::pear::module { "XML_Serializer": use_package => "no", preferred_state => "beta" } # Installs pear component with pear command
|
22
|
+
php::pear::config { "http_proxy": value => "$proxy_server" } # Configures pear environment
|
23
|
+
|
24
|
+
php::pecl::module { "xslcache": } # Installs pecl module using OS package
|
25
|
+
php::pecl::module { "xslcache": use_package => "no", preferred_state => "beta" } # Installs pecl module with pecl command
|
26
|
+
php::pecl::config { "http_proxy": value => "$proxy_server" } # Configures pecl environment
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# Class: php
|
2
|
+
#
|
3
|
+
# Installs Php
|
4
|
+
#
|
5
|
+
# Usage:
|
6
|
+
# include php
|
7
|
+
#
|
8
|
+
class php {
|
9
|
+
|
10
|
+
package { php:
|
11
|
+
name => $operatingsystem ? {
|
12
|
+
ubuntu => "php5",
|
13
|
+
debian => "php5",
|
14
|
+
suse => "php5",
|
15
|
+
default => "php",
|
16
|
+
},
|
17
|
+
ensure => present,
|
18
|
+
}
|
19
|
+
|
20
|
+
package { php-common:
|
21
|
+
name => $operatingsystem ? {
|
22
|
+
ubuntu => "php5-common",
|
23
|
+
debian => "php5-common",
|
24
|
+
suse => undef,
|
25
|
+
default => "php-common",
|
26
|
+
},
|
27
|
+
ensure => present,
|
28
|
+
}
|
29
|
+
|
30
|
+
package { php-cli:
|
31
|
+
name => $operatingsystem ? {
|
32
|
+
ubuntu => "php5-cli",
|
33
|
+
debian => "php5-cli",
|
34
|
+
suse => undef,
|
35
|
+
default => "php-cli",
|
36
|
+
},
|
37
|
+
ensure => present,
|
38
|
+
}
|
39
|
+
|
40
|
+
|
41
|
+
}
|
42
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Define: php::module
|
2
|
+
#
|
3
|
+
# Installs the defined php module
|
4
|
+
#
|
5
|
+
# Usage:
|
6
|
+
# php::module { modulename: }
|
7
|
+
# Example:
|
8
|
+
# php::module { mysql: }
|
9
|
+
#
|
10
|
+
define php::module {
|
11
|
+
|
12
|
+
include php
|
13
|
+
|
14
|
+
package { "php-${name}":
|
15
|
+
name => $operatingsystem ? {
|
16
|
+
ubuntu => "php5-${name}",
|
17
|
+
debian => "php5-${name}",
|
18
|
+
default => "php-${name}",
|
19
|
+
},
|
20
|
+
ensure => present,
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Define: php::pear::module
|
2
|
+
#
|
3
|
+
# Installs the defined php pear component
|
4
|
+
#
|
5
|
+
# Usage:
|
6
|
+
# php::pear::module { packagename: }
|
7
|
+
# Example:
|
8
|
+
# php::pear::module { Crypt-CHAP: }
|
9
|
+
|
10
|
+
define php::pear::module {
|
11
|
+
|
12
|
+
include php::pear
|
13
|
+
|
14
|
+
exec { "pear-${name}":
|
15
|
+
command => "pear install ${name}",
|
16
|
+
unless => "pear info ${name}",
|
17
|
+
require => Package["php-pear"],
|
18
|
+
}
|
19
|
+
|
20
|
+
}
|
21
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Class: php::pear
|
2
|
+
#
|
3
|
+
# Installs Pear for PHP module
|
4
|
+
#
|
5
|
+
# Usage:
|
6
|
+
# include php::pear
|
7
|
+
|
8
|
+
class php::pear {
|
9
|
+
|
10
|
+
include php
|
11
|
+
|
12
|
+
package { php-pear:
|
13
|
+
name => $operatingsystem ? {
|
14
|
+
default => "php-pear",
|
15
|
+
},
|
16
|
+
ensure => present,
|
17
|
+
}
|
18
|
+
|
19
|
+
}
|
20
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Define: php::pecl::config
|
2
|
+
#
|
3
|
+
# Configures pecl
|
4
|
+
#
|
5
|
+
# Usage:
|
6
|
+
# php::pecl::config { http_proxy: value => "myproxy:8080" }
|
7
|
+
|
8
|
+
define php::pecl::config (value) {
|
9
|
+
|
10
|
+
include php::pecl
|
11
|
+
|
12
|
+
exec { "pecl-config-set-${name}":
|
13
|
+
command => "pecl config-set ${name} ${value}",
|
14
|
+
unless => "pecl config-get ${name} | grep ${value}",
|
15
|
+
require => Package["php-pear"],
|
16
|
+
}
|
17
|
+
|
18
|
+
}
|
19
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Define: php::pecl::module
|
2
|
+
#
|
3
|
+
# Installs the defined php pecl component
|
4
|
+
#
|
5
|
+
# Variables:
|
6
|
+
# $use_package (default="yes") - Tries to install pecl module with the relevant package
|
7
|
+
# If set to "no" it installs the module via pecl command
|
8
|
+
# $preferred_state (default="stable") - Define which preferred state to use when installing Pear modules via pecl
|
9
|
+
# command line (when use_package=no)
|
10
|
+
# $auto_answer (default="\\n") - The answer(s) to give to pecl prompts for unattended installs. Note that special chars must be \ escaped.
|
11
|
+
#
|
12
|
+
# Usage:
|
13
|
+
# php::pecl::module { packagename: }
|
14
|
+
#
|
15
|
+
# Example:
|
16
|
+
# php::pecl::module { "xslcache": use_package => "no", preferred_state => "beta" }
|
17
|
+
|
18
|
+
define php::pecl::module (use_package="yes", preferred_state="stable", auto_answer="\\n" ) {
|
19
|
+
|
20
|
+
include php::pecl
|
21
|
+
|
22
|
+
case $use_package {
|
23
|
+
yes: {
|
24
|
+
package { "php-${name}":
|
25
|
+
name => $operatingsystem ? {
|
26
|
+
ubuntu => "php5-${name}",
|
27
|
+
debian => "php5-${name}",
|
28
|
+
default => "php-${name}",
|
29
|
+
},
|
30
|
+
ensure => present,
|
31
|
+
notify => Service["apache"],
|
32
|
+
}
|
33
|
+
}
|
34
|
+
default: {
|
35
|
+
exec { "pecl-${name}":
|
36
|
+
command => "printf \"${auto_answer}\" | pecl -d preferred_state=${preferred_state} install ${name}",
|
37
|
+
unless => "pecl info ${name}",
|
38
|
+
require => Package["php-pear"],
|
39
|
+
}
|
40
|
+
}
|
41
|
+
} # End Case
|
42
|
+
|
43
|
+
}
|
44
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Class: php::soap
|
2
|
+
#
|
3
|
+
# Installs SOAP for PHP module
|
4
|
+
#
|
5
|
+
# Usage:
|
6
|
+
# include php::soap
|
7
|
+
|
8
|
+
class php::soap {
|
9
|
+
|
10
|
+
include php
|
11
|
+
|
12
|
+
package { php-soap:
|
13
|
+
name => $operatingsystem ? {
|
14
|
+
default => "php-soap",
|
15
|
+
},
|
16
|
+
ensure => present,
|
17
|
+
}
|
18
|
+
|
19
|
+
}
|
20
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright (c) 2008, Luke Kanies, luke@madstop.com
|
2
|
+
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
4
|
+
purpose with or without fee is hereby granted, provided that the above
|
5
|
+
copyright notice and this permission notice appear in all copies.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
8
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
9
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
10
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
11
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
12
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
13
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# Copyright (c) 2008, Luke Kanies, luke@madstop.com
|
2
|
+
#
|
3
|
+
# Permission to use, copy, modify, and/or distribute this software for any
|
4
|
+
# purpose with or without fee is hereby granted, provided that the above
|
5
|
+
# copyright notice and this permission notice appear in all copies.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
8
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
9
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
10
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
11
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
12
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
13
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
|
+
|
15
|
+
define postgres::database($ensure, $owner = false) {
|
16
|
+
$ownerstring = $owner ? {
|
17
|
+
false => "",
|
18
|
+
default => "-O $owner"
|
19
|
+
}
|
20
|
+
|
21
|
+
case $ensure {
|
22
|
+
present: {
|
23
|
+
exec { "Create $name postgres db":
|
24
|
+
command => "/usr/bin/createdb $ownerstring $name",
|
25
|
+
user => "postgres",
|
26
|
+
unless => "/usr/bin/psql -l | grep '$name *|'"
|
27
|
+
}
|
28
|
+
}
|
29
|
+
absent: {
|
30
|
+
exec { "Remove $name postgres db":
|
31
|
+
command => "/usr/bin/drop $name",
|
32
|
+
onlyif => "/usr/bin/psql -l | grep '$name *|'",
|
33
|
+
user => "postgres"
|
34
|
+
}
|
35
|
+
}
|
36
|
+
default: {
|
37
|
+
fail "Invalid 'ensure' value '$ensure' for postgres::database"
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Copyright (c) 2008, Luke Kanies, luke@madstop.com
|
2
|
+
#
|
3
|
+
# Permission to use, copy, modify, and/or distribute this software for any
|
4
|
+
# purpose with or without fee is hereby granted, provided that the above
|
5
|
+
# copyright notice and this permission notice appear in all copies.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
8
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
9
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
10
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
11
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
12
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
13
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
|
+
|
15
|
+
class postgres {
|
16
|
+
package { [postgresql]: ensure => installed }
|
17
|
+
package { [libpq-dev]: ensure => installed }
|
18
|
+
|
19
|
+
service { "postgresql":
|
20
|
+
ensure => running,
|
21
|
+
enable => true,
|
22
|
+
hasstatus => true,
|
23
|
+
subscribe => [Package[postgresql]]
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# Copyright (c) 2008, Luke Kanies, luke@madstop.com
|
2
|
+
#
|
3
|
+
# Permission to use, copy, modify, and/or distribute this software for any
|
4
|
+
# purpose with or without fee is hereby granted, provided that the above
|
5
|
+
# copyright notice and this permission notice appear in all copies.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
8
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
9
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
10
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
11
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
12
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
13
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
|
+
|
15
|
+
define postgres::role($ensure, $password = false) {
|
16
|
+
$passtext = $password ? {
|
17
|
+
false => "",
|
18
|
+
default => "PASSWORD '$password'"
|
19
|
+
}
|
20
|
+
case $ensure {
|
21
|
+
present: {
|
22
|
+
# The createuser command always prompts for the password.
|
23
|
+
exec { "Create $name postgres role":
|
24
|
+
command => "/usr/bin/psql -c \"CREATE ROLE $name $passtext\"",
|
25
|
+
user => "postgres",
|
26
|
+
unless => "/usr/bin/psql -c '\\du' | grep '^ *$name *|'"
|
27
|
+
}
|
28
|
+
}
|
29
|
+
absent: {
|
30
|
+
exec { "Remove $name postgres role":
|
31
|
+
command => "/usr/bin/dropeuser $name",
|
32
|
+
user => "postgres",
|
33
|
+
onlyif => "/usr/bin/psql -c '\\du' | grep '$name *|'"
|
34
|
+
}
|
35
|
+
}
|
36
|
+
default: {
|
37
|
+
fail "Invalid 'ensure' value '$ensure' for postgres::role"
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
# Set where stow is going to be installed:
|
4
|
+
if (( UID == 0 )) ; then
|
5
|
+
PACKAGES_PATH=/usr/local
|
6
|
+
else
|
7
|
+
PACKAGES_PATH=$HOME/.packages
|
8
|
+
fi
|
9
|
+
|
10
|
+
mkdir -p $PACKAGES_PATH/{bin,share,include,lib}
|
11
|
+
|
12
|
+
PACKAGE=ruby-1.9.3-p0
|
13
|
+
STOW_PATH=$PACKAGES_PATH/stow
|
14
|
+
PREFIX=$STOW_PATH/$PACKAGE
|
15
|
+
|
16
|
+
pushd $(mktemp -d /tmp/stows-ruby.XXXXXXXXXX)
|
17
|
+
curl -O http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
|
18
|
+
tar xzf yaml-0.1.4.tar.gz
|
19
|
+
cd yaml-0.1.4
|
20
|
+
./configure --prefix=$PREFIX
|
21
|
+
make && make install
|
22
|
+
popd
|
23
|
+
|
24
|
+
pushd $(mktemp -d /tmp/stows-ruby.XXXXXXXXXX)
|
25
|
+
curl -O http://ftp.ruby-lang.org/pub/ruby/1.9/$PACKAGE.tar.gz
|
26
|
+
tar xzf $PACKAGE.tar.gz
|
27
|
+
cd $PACKAGE
|
28
|
+
./configure --prefix=$PREFIX --enable-shared --disable-install-doc --with-opt-dir=$PACKAGES_PATH/lib
|
29
|
+
make && make install
|
30
|
+
popd
|
31
|
+
|
32
|
+
# Install latest RubyGems.
|
33
|
+
pushd $PREFIX
|
34
|
+
./bin/gem update --system
|
35
|
+
popd
|
36
|
+
|
37
|
+
stow -d $STOW_PATH -t $PACKAGES_PATH $PACKAGE
|
38
|
+
|
39
|
+
# You can verify Ruby has been properly installed with Yaml support by
|
40
|
+
# running the following command:
|
41
|
+
#
|
42
|
+
# $ ruby -rpsych -e 'puts Psych.load("win: true")'
|
43
|
+
#
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class ruby($version = 'ruby-1.9.3-p0') {
|
2
|
+
file { "ruby-stow-boot":
|
3
|
+
ensure => 'present',
|
4
|
+
path => '/root/install-ruby-stow',
|
5
|
+
owner => 'root', group => 'root', mode => '0774',
|
6
|
+
source => 'puppet:///modules/ruby/install-ruby-stow';
|
7
|
+
}
|
8
|
+
|
9
|
+
exec { "ruby-stow":
|
10
|
+
command => "/root/install-ruby-stow",
|
11
|
+
creates => "/usr/local/stow/${version}",
|
12
|
+
timeout => "-1",
|
13
|
+
require => [Package["stow"], File["ruby-stow-boot"]];
|
14
|
+
}
|
15
|
+
|
16
|
+
if ! defined(Package['build-essential']) { package { 'build-essential': ensure => installed } }
|
17
|
+
if ! defined(Package['libcurl4-openssl-dev']) { package { 'libcurl4-openssl-dev': ensure => installed } }
|
18
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class rvm::dependencies {
|
2
|
+
if ! defined(Package['build-essential']) { package { 'build-essential': ensure => installed } }
|
3
|
+
if ! defined(Package['bison']) { package { 'bison': ensure => installed } }
|
4
|
+
if ! defined(Package['openssl']) { package { 'openssl': ensure => installed } }
|
5
|
+
if ! defined(Package['libreadline6']) { package { 'libreadline6': ensure => installed } }
|
6
|
+
if ! defined(Package['libreadline6-dev']) { package { 'libreadline6-dev': ensure => installed } }
|
7
|
+
if ! defined(Package['curl']) { package { 'curl': ensure => installed } }
|
8
|
+
if ! defined(Package['git-core']) { package { 'git-core': ensure => installed } }
|
9
|
+
if ! defined(Package['zlib1g']) { package { 'zlib1g': ensure => installed } }
|
10
|
+
if ! defined(Package['zlib1g-dev']) { package { 'zlib1g-dev': ensure => installed } }
|
11
|
+
if ! defined(Package['libssl-dev']) { package { 'libssl-dev': ensure => installed } }
|
12
|
+
if ! defined(Package['libsqlite3-0']) { package { 'libsqlite3-0': ensure => installed } }
|
13
|
+
if ! defined(Package['libsqlite3-dev']) { package { 'libsqlite3-dev': ensure => installed } }
|
14
|
+
if ! defined(Package['sqlite3']) { package { 'sqlite3': ensure => installed } }
|
15
|
+
if ! defined(Package['libxml2-dev']) { package { 'libxml2-dev': ensure => installed } }
|
16
|
+
if ! defined(Package['libxslt1-dev']) { package { 'libxslt1-dev': ensure => installed, alias => 'libxslt-dev' } }
|
17
|
+
if ! defined(Package['autoconf']) { package { 'autoconf': ensure => installed } }
|
18
|
+
if ! defined(Package['libc6-dev']) { package { 'libc6-dev': ensure => installed } }
|
19
|
+
if ! defined(Package['ncurses-dev']) { package { 'ncurses-dev': ensure => installed } }
|
20
|
+
|
21
|
+
#Remove libyaml as Psych does not works well
|
22
|
+
if ! defined(Package['libyaml-dev']) { package { 'libyaml-dev': ensure => absent } }
|
23
|
+
if ! defined(Package['libyaml-0-2']) { package { 'libyaml-0-2': ensure => absent } }
|
24
|
+
}
|