freighthop 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Puppetfile +4 -3
- data/Puppetfile.lock +14 -2
- data/Vagrantfile +5 -1
- data/data/common.json +4 -3
- data/freighthop.gemspec +1 -1
- data/lib/freighthop/cli/checks.rb +12 -0
- data/lib/freighthop/cli/help.rb +7 -0
- data/lib/freighthop/cli/init.rb +35 -0
- data/lib/freighthop/cli/ssh.rb +1 -0
- data/lib/freighthop/cli/vagrant.rb +1 -0
- data/lib/freighthop/cli.rb +5 -17
- data/lib/freighthop/config.rb +5 -1
- data/lib/freighthop/version.rb +1 -1
- data/lib/freighthop.rb +6 -1
- data/local_modules/freighthop/manifests/database/mysql/grant.pp +11 -0
- data/local_modules/freighthop/manifests/database/mysql.pp +5 -15
- data/local_modules/freighthop/manifests/database/postgres.pp +2 -2
- data/local_modules/freighthop/manifests/database.pp +3 -3
- data/local_modules/freighthop/manifests/init.pp +6 -23
- data/local_modules/freighthop/manifests/language/ruby.pp +5 -25
- data/local_modules/freighthop/manifests/language.pp +1 -4
- data/local_modules/freighthop/manifests/packages.pp +2 -12
- data/local_modules/freighthop/manifests/params.pp +19 -11
- data/local_modules/freighthop/manifests/web/apache.pp +60 -0
- data/local_modules/freighthop/manifests/web/nginx.pp +22 -0
- data/local_modules/freighthop/manifests/web/ssl.pp +13 -0
- data/local_modules/freighthop/manifests/web.pp +25 -21
- data/local_modules/freighthop/templates/apache/passenger.conf.erb +18 -0
- data/local_modules/freighthop/templates/nginx/vagrant-rails.conf.erb +5 -3
- data/modules/apache/CHANGELOG.md +172 -0
- data/modules/apache/CONTRIBUTING.md +234 -0
- data/modules/apache/Gemfile +25 -0
- data/modules/apache/LICENSE +15 -0
- data/modules/apache/Modulefile +12 -0
- data/modules/apache/README.md +1515 -0
- data/modules/apache/README.passenger.md +93 -0
- data/modules/apache/Rakefile +1 -0
- data/modules/apache/files/httpd +24 -0
- data/modules/apache/lib/puppet/provider/a2mod/a2mod.rb +35 -0
- data/modules/apache/lib/puppet/provider/a2mod/gentoo.rb +116 -0
- data/modules/apache/lib/puppet/provider/a2mod/modfix.rb +12 -0
- data/modules/apache/lib/puppet/provider/a2mod/redhat.rb +60 -0
- data/modules/apache/lib/puppet/provider/a2mod.rb +34 -0
- data/modules/apache/lib/puppet/type/a2mod.rb +30 -0
- data/modules/apache/manifests/balancer.pp +80 -0
- data/modules/apache/manifests/balancermember.pp +52 -0
- data/modules/apache/manifests/confd/no_accf.pp +10 -0
- data/modules/apache/manifests/default_confd_files.pp +12 -0
- data/modules/apache/manifests/default_mods/load.pp +8 -0
- data/modules/apache/manifests/default_mods.pp +108 -0
- data/modules/apache/manifests/dev.pp +11 -0
- data/modules/apache/manifests/init.pp +329 -0
- data/modules/apache/manifests/listen.pp +9 -0
- data/modules/apache/manifests/mod/alias.pp +17 -0
- data/modules/apache/manifests/mod/auth_basic.pp +3 -0
- data/modules/apache/manifests/mod/auth_kerb.pp +5 -0
- data/modules/apache/manifests/mod/authnz_ldap.pp +19 -0
- data/modules/apache/manifests/mod/autoindex.pp +12 -0
- data/modules/apache/manifests/mod/cache.pp +3 -0
- data/modules/apache/manifests/mod/cgi.pp +4 -0
- data/modules/apache/manifests/mod/cgid.pp +23 -0
- data/modules/apache/manifests/mod/dav.pp +3 -0
- data/modules/apache/manifests/mod/dav_fs.pp +20 -0
- data/modules/apache/manifests/mod/dav_svn.pp +5 -0
- data/modules/apache/manifests/mod/deflate.pp +12 -0
- data/modules/apache/manifests/mod/dev.pp +5 -0
- data/modules/apache/manifests/mod/dir.pp +21 -0
- data/modules/apache/manifests/mod/disk_cache.pp +24 -0
- data/modules/apache/manifests/mod/event.pp +54 -0
- data/modules/apache/manifests/mod/expires.pp +3 -0
- data/modules/apache/manifests/mod/fastcgi.pp +24 -0
- data/modules/apache/manifests/mod/fcgid.pp +3 -0
- data/modules/apache/manifests/mod/headers.pp +3 -0
- data/modules/apache/manifests/mod/include.pp +3 -0
- data/modules/apache/manifests/mod/info.pp +14 -0
- data/modules/apache/manifests/mod/itk.pp +64 -0
- data/modules/apache/manifests/mod/ldap.pp +12 -0
- data/modules/apache/manifests/mod/mime.pp +21 -0
- data/modules/apache/manifests/mod/mime_magic.pp +14 -0
- data/modules/apache/manifests/mod/negotiation.pp +12 -0
- data/modules/apache/manifests/mod/nss.pp +25 -0
- data/modules/apache/manifests/mod/passenger.pp +38 -0
- data/modules/apache/manifests/mod/perl.pp +3 -0
- data/modules/apache/manifests/mod/peruser.pp +73 -0
- data/modules/apache/manifests/mod/php.pp +26 -0
- data/modules/apache/manifests/mod/prefork.pp +74 -0
- data/modules/apache/manifests/mod/proxy.pp +15 -0
- data/modules/apache/manifests/mod/proxy_ajp.pp +4 -0
- data/modules/apache/manifests/mod/proxy_balancer.pp +10 -0
- data/modules/apache/manifests/mod/proxy_html.pp +28 -0
- data/modules/apache/manifests/mod/proxy_http.pp +4 -0
- data/modules/apache/manifests/mod/python.pp +5 -0
- data/modules/apache/manifests/mod/reqtimeout.pp +12 -0
- data/modules/apache/manifests/mod/rewrite.pp +4 -0
- data/modules/apache/manifests/mod/rpaf.pp +20 -0
- data/modules/apache/manifests/mod/setenvif.pp +12 -0
- data/modules/apache/manifests/mod/ssl.pp +26 -0
- data/modules/apache/manifests/mod/status.pp +42 -0
- data/modules/apache/manifests/mod/suphp.pp +14 -0
- data/modules/apache/manifests/mod/userdir.pp +17 -0
- data/modules/apache/manifests/mod/vhost_alias.pp +3 -0
- data/modules/apache/manifests/mod/worker.pp +75 -0
- data/modules/apache/manifests/mod/wsgi.pp +21 -0
- data/modules/apache/manifests/mod/xsendfile.pp +4 -0
- data/modules/apache/manifests/mod.pp +120 -0
- data/modules/apache/manifests/namevirtualhost.pp +9 -0
- data/modules/apache/manifests/package.pp +48 -0
- data/modules/apache/manifests/params.pp +207 -0
- data/modules/apache/manifests/peruser/multiplexer.pp +17 -0
- data/modules/apache/manifests/peruser/processor.pp +17 -0
- data/modules/apache/manifests/php.pp +18 -0
- data/modules/apache/manifests/proxy.pp +15 -0
- data/modules/apache/manifests/python.pp +18 -0
- data/modules/apache/manifests/service.pp +35 -0
- data/modules/apache/manifests/ssl.pp +18 -0
- data/modules/apache/manifests/vhost.pp +516 -0
- data/modules/apache/spec/acceptance/basic_spec.rb +12 -0
- data/modules/apache/spec/acceptance/class_spec.rb +58 -0
- data/modules/apache/spec/acceptance/default_mods_spec.rb +97 -0
- data/modules/apache/spec/acceptance/itk_spec.rb +35 -0
- data/modules/apache/spec/acceptance/mod_php_spec.rb +52 -0
- data/modules/apache/spec/acceptance/mod_suphp_spec.rb +44 -0
- data/modules/apache/spec/acceptance/nodesets/centos-64-x64.yml +8 -0
- data/modules/apache/spec/acceptance/nodesets/default.yml +8 -0
- data/modules/apache/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml +8 -0
- data/modules/apache/spec/acceptance/nodesets/vagrant.key +27 -0
- data/modules/apache/spec/acceptance/prefork_worker_spec.rb +81 -0
- data/modules/apache/spec/acceptance/service_spec.rb +19 -0
- data/modules/apache/spec/acceptance/vhost_spec.rb +290 -0
- data/modules/apache/spec/classes/apache_spec.rb +464 -0
- data/modules/apache/spec/classes/dev_spec.rb +38 -0
- data/modules/apache/spec/classes/mod/auth_kerb_spec.rb +41 -0
- data/modules/apache/spec/classes/mod/authnz_ldap_spec.rb +65 -0
- data/modules/apache/spec/classes/mod/dav_svn_spec.rb +41 -0
- data/modules/apache/spec/classes/mod/dev_spec.rb +23 -0
- data/modules/apache/spec/classes/mod/dir_spec.rb +88 -0
- data/modules/apache/spec/classes/mod/event_spec.rb +17 -0
- data/modules/apache/spec/classes/mod/fastcgi_spec.rb +32 -0
- data/modules/apache/spec/classes/mod/fcgid_spec.rb +41 -0
- data/modules/apache/spec/classes/mod/info_spec.rb +99 -0
- data/modules/apache/spec/classes/mod/itk_spec.rb +31 -0
- data/modules/apache/spec/classes/mod/mime_magic_spec.rb +93 -0
- data/modules/apache/spec/classes/mod/passenger_spec.rb +112 -0
- data/modules/apache/spec/classes/mod/perl_spec.rb +41 -0
- data/modules/apache/spec/classes/mod/peruser_spec.rb +17 -0
- data/modules/apache/spec/classes/mod/php_spec.rb +99 -0
- data/modules/apache/spec/classes/mod/prefork_spec.rb +47 -0
- data/modules/apache/spec/classes/mod/proxy_html_spec.rb +45 -0
- data/modules/apache/spec/classes/mod/python_spec.rb +41 -0
- data/modules/apache/spec/classes/mod/rpaf_spec.rb +77 -0
- data/modules/apache/spec/classes/mod/ssl_spec.rb +53 -0
- data/modules/apache/spec/classes/mod/status_spec.rb +166 -0
- data/modules/apache/spec/classes/mod/suphp_spec.rb +27 -0
- data/modules/apache/spec/classes/mod/worker_spec.rb +44 -0
- data/modules/apache/spec/classes/mod/wsgi_spec.rb +54 -0
- data/modules/apache/spec/classes/params_spec.rb +21 -0
- data/modules/apache/spec/classes/service_spec.rb +109 -0
- data/modules/apache/spec/defines/mod_spec.rb +105 -0
- data/modules/apache/spec/defines/vhost_spec.rb +1152 -0
- data/modules/apache/spec/fixtures/modules/site_apache/templates/fake.conf.erb +1 -0
- data/modules/apache/spec/spec.opts +4 -0
- data/modules/apache/spec/spec_helper.rb +1 -0
- data/modules/apache/spec/spec_helper_acceptance.rb +27 -0
- data/modules/apache/spec/unit/provider/a2mod/gentoo_spec.rb +184 -0
- data/modules/apache/templates/confd/no-accf.conf.erb +4 -0
- data/modules/apache/templates/httpd.conf.erb +92 -0
- data/modules/apache/templates/listen.erb +6 -0
- data/modules/apache/templates/mod/alias.conf.erb +9 -0
- data/modules/apache/templates/mod/authnz_ldap.conf.erb +5 -0
- data/modules/apache/templates/mod/autoindex.conf.erb +56 -0
- data/modules/apache/templates/mod/cgid.conf.erb +1 -0
- data/modules/apache/templates/mod/dav_fs.conf.erb +1 -0
- data/modules/apache/templates/mod/deflate.conf.erb +4 -0
- data/modules/apache/templates/mod/dir.conf.erb +1 -0
- data/modules/apache/templates/mod/disk_cache.conf.erb +8 -0
- data/modules/apache/templates/mod/event.conf.erb +9 -0
- data/modules/apache/templates/mod/fastcgi.conf.erb +6 -0
- data/modules/apache/templates/mod/info.conf.erb +6 -0
- data/modules/apache/templates/mod/itk.conf.erb +8 -0
- data/modules/apache/templates/mod/ldap.conf.erb +7 -0
- data/modules/apache/templates/mod/mime.conf.erb +36 -0
- data/modules/apache/templates/mod/mime_magic.conf.erb +1 -0
- data/modules/apache/templates/mod/mpm_event.conf.erb +9 -0
- data/modules/apache/templates/mod/negotiation.conf.erb +2 -0
- data/modules/apache/templates/mod/nss.conf.erb +228 -0
- data/modules/apache/templates/mod/passenger.conf.erb +30 -0
- data/modules/apache/templates/mod/peruser.conf.erb +12 -0
- data/modules/apache/templates/mod/php5.conf.erb +30 -0
- data/modules/apache/templates/mod/prefork.conf.erb +8 -0
- data/modules/apache/templates/mod/proxy.conf.erb +23 -0
- data/modules/apache/templates/mod/proxy_html.conf.erb +24 -0
- data/modules/apache/templates/mod/reqtimeout.conf.erb +2 -0
- data/modules/apache/templates/mod/rpaf.conf.erb +15 -0
- data/modules/apache/templates/mod/setenvif.conf.erb +34 -0
- data/modules/apache/templates/mod/ssl.conf.erb +24 -0
- data/modules/apache/templates/mod/status.conf.erb +12 -0
- data/modules/apache/templates/mod/suphp.conf.erb +19 -0
- data/modules/apache/templates/mod/userdir.conf.erb +19 -0
- data/modules/apache/templates/mod/worker.conf.erb +9 -0
- data/modules/apache/templates/mod/wsgi.conf.erb +13 -0
- data/modules/apache/templates/namevirtualhost.erb +8 -0
- data/modules/apache/templates/ports_header.erb +5 -0
- data/modules/apache/templates/vhost/_aliases.erb +12 -0
- data/modules/apache/templates/vhost/_block.erb +10 -0
- data/modules/apache/templates/vhost/_custom_fragment.erb +5 -0
- data/modules/apache/templates/vhost/_directories.erb +143 -0
- data/modules/apache/templates/vhost/_error_document.erb +7 -0
- data/modules/apache/templates/vhost/_fastcgi.erb +18 -0
- data/modules/apache/templates/vhost/_itk.erb +28 -0
- data/modules/apache/templates/vhost/_php_admin.erb +12 -0
- data/modules/apache/templates/vhost/_proxy.erb +20 -0
- data/modules/apache/templates/vhost/_rack.erb +7 -0
- data/modules/apache/templates/vhost/_redirect.erb +12 -0
- data/modules/apache/templates/vhost/_requestheader.erb +10 -0
- data/modules/apache/templates/vhost/_rewrite.erb +40 -0
- data/modules/apache/templates/vhost/_scriptalias.erb +24 -0
- data/modules/apache/templates/vhost/_serveralias.erb +7 -0
- data/modules/apache/templates/vhost/_setenv.erb +12 -0
- data/modules/apache/templates/vhost/_ssl.erb +41 -0
- data/modules/apache/templates/vhost/_suphp.erb +11 -0
- data/modules/apache/templates/vhost/_wsgi.erb +15 -0
- data/modules/apache/templates/vhost.conf.erb +63 -0
- data/modules/apache/tests/apache.pp +6 -0
- data/modules/apache/tests/dev.pp +1 -0
- data/modules/apache/tests/init.pp +1 -0
- data/modules/apache/tests/mod_load_params.pp +11 -0
- data/modules/apache/tests/mods.pp +9 -0
- data/modules/apache/tests/mods_custom.pp +16 -0
- data/modules/apache/tests/php.pp +4 -0
- data/modules/apache/tests/vhost.pp +237 -0
- data/modules/apache/tests/vhost_directories.pp +30 -0
- data/modules/apache/tests/vhost_ip_based.pp +25 -0
- data/modules/apache/tests/vhost_ssl.pp +23 -0
- data/modules/apache/tests/vhosts_without_listen.pp +53 -0
- data/modules/freighthop/manifests/database/mysql/grant.pp +11 -0
- data/modules/freighthop/manifests/database/mysql.pp +5 -15
- data/modules/freighthop/manifests/database/postgres.pp +2 -2
- data/modules/freighthop/manifests/database.pp +3 -3
- data/modules/freighthop/manifests/init.pp +6 -23
- data/modules/freighthop/manifests/language/ruby.pp +5 -25
- data/modules/freighthop/manifests/language.pp +1 -4
- data/modules/freighthop/manifests/packages.pp +2 -12
- data/modules/freighthop/manifests/params.pp +19 -11
- data/modules/freighthop/manifests/web/apache.pp +60 -0
- data/modules/freighthop/manifests/web/nginx.pp +22 -0
- data/modules/freighthop/manifests/web/ssl.pp +13 -0
- data/modules/freighthop/manifests/web.pp +25 -21
- data/modules/freighthop/templates/apache/passenger.conf.erb +18 -0
- data/modules/freighthop/templates/nginx/vagrant-rails.conf.erb +5 -3
- data/modules/rbenv/AUTHORS +11 -0
- data/modules/rbenv/CHANGELOG.md +70 -0
- data/modules/rbenv/Gemfile +5 -10
- data/modules/rbenv/Gemfile.lock +16 -58
- data/modules/rbenv/Modulefile +7 -7
- data/modules/rbenv/README.md +156 -20
- data/modules/rbenv/Rakefile +18 -24
- data/modules/rbenv/TODO +10 -0
- data/modules/rbenv/bin/autospec +16 -0
- data/modules/rbenv/bin/facter +16 -0
- data/modules/rbenv/bin/filebucket +16 -0
- data/modules/rbenv/bin/hiera +16 -0
- data/modules/rbenv/bin/htmldiff +16 -0
- data/modules/rbenv/bin/ldiff +16 -0
- data/modules/rbenv/bin/pi +16 -0
- data/modules/rbenv/bin/puppet +16 -0
- data/modules/rbenv/bin/puppet-lint +16 -0
- data/modules/rbenv/bin/puppet-module +16 -0
- data/modules/rbenv/bin/puppetca +16 -0
- data/modules/rbenv/bin/puppetd +16 -0
- data/modules/rbenv/bin/puppetdoc +16 -0
- data/modules/rbenv/bin/puppetmasterd +16 -0
- data/modules/rbenv/bin/puppetqd +16 -0
- data/modules/rbenv/bin/puppetrun +16 -0
- data/modules/rbenv/bin/rake +16 -0
- data/modules/rbenv/bin/ralsh +16 -0
- data/modules/rbenv/bin/rspec +16 -0
- data/modules/rbenv/bin/rspec-puppet-init +16 -0
- data/modules/rbenv/lib/puppet/provider/rbenvgem/default.rb +50 -0
- data/modules/rbenv/lib/puppet/type/rbenvgem.rb +62 -0
- data/modules/rbenv/manifests/bundle.pp +36 -0
- data/modules/rbenv/manifests/client.pp +48 -0
- data/modules/rbenv/manifests/compile.pp +102 -0
- data/modules/rbenv/manifests/definition.pp +31 -0
- data/modules/rbenv/manifests/dependencies/centos.pp +25 -0
- data/modules/rbenv/manifests/dependencies/suse.pp +28 -0
- data/modules/rbenv/manifests/dependencies/ubuntu.pp +17 -0
- data/modules/rbenv/manifests/dependencies.pp +8 -0
- data/modules/rbenv/manifests/gem.pp +29 -0
- data/modules/rbenv/manifests/install.pp +55 -0
- data/modules/rbenv/manifests/plugin/rbenvvars.pp +16 -0
- data/modules/rbenv/manifests/plugin/rubybuild.pp +16 -0
- data/modules/rbenv/manifests/plugin.pp +40 -0
- data/modules/rbenv/metadata.json +99 -31
- data/modules/rbenv/spec/classes/dependencies_spec.rb +20 -0
- data/modules/rbenv/spec/defines/rbenv__compile_spec.rb +34 -0
- data/modules/rbenv/spec/defines/rbenv__definition_spec.rb +40 -0
- data/modules/rbenv/spec/defines/rbenv__install_spec.rb +24 -0
- data/modules/rbenv/spec/defines/rbenv__plugin__rbenvvars_spec.rb +14 -0
- data/modules/rbenv/spec/defines/rbenv__plugin__rubybuild_spec.rb +14 -0
- data/modules/rbenv/spec/defines/rbenv__plugin_spec.rb +31 -0
- data/modules/rbenv/spec/fixtures/manifests/site.pp +0 -0
- data/modules/rbenv/spec/spec_helper.rb +6 -1
- data/modules/rbenv/templates/Gemfile.erb +5 -0
- data/modules/rbenv/templates/dot.rbenvrc.erb +8 -0
- metadata +271 -23
- data/modules/rbenv/CHANGELOG +0 -33
- data/modules/rbenv/LICENSE +0 -20
- data/modules/rbenv/manifests/alias.pp +0 -32
- data/modules/rbenv/manifests/global.pp +0 -22
- data/modules/rbenv/manifests/init.pp +0 -30
- data/modules/rbenv/manifests/params.pp +0 -16
- data/modules/rbenv/manifests/rehash.pp +0 -28
- data/modules/rbenv/manifests/version.pp +0 -63
- data/modules/rbenv/spec/classes/rbenv__global_spec.rb +0 -31
- data/modules/rbenv/spec/classes/rbenv_spec.rb +0 -30
- data/modules/rbenv/spec/defines/rbenv__alias_spec.rb +0 -22
- data/modules/rbenv/spec/defines/rbenv__rehash_spec.rb +0 -22
- data/modules/rbenv/spec/defines/rbenv__version_spec.rb +0 -60
- data/modules/rbenv/spec/spec_helper_system.rb +0 -16
- data/modules/rbenv/spec/system/basic_spec.rb +0 -13
- data/modules/rbenv/templates/etc/profile.d/rbenv.sh.erb +0 -2
- data/modules/rbenv/tests/init.pp +0 -12
@@ -0,0 +1,8 @@
|
|
1
|
+
class rbenv::dependencies {
|
2
|
+
case $::osfamily {
|
3
|
+
debian : { require rbenv::dependencies::ubuntu }
|
4
|
+
redhat : { require rbenv::dependencies::centos }
|
5
|
+
suse : { require rbenv::dependencies::suse }
|
6
|
+
default : { notice("Could not load dependencies for ${::osfamily}") }
|
7
|
+
}
|
8
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Install a gem under rbenv for a certain user's ruby version.
|
2
|
+
# Requires rbenv::compile for the passed in user and ruby version
|
3
|
+
#
|
4
|
+
define rbenv::gem(
|
5
|
+
$user,
|
6
|
+
$ruby,
|
7
|
+
$gem = $title,
|
8
|
+
$home = '',
|
9
|
+
$root = '',
|
10
|
+
$ensure = present
|
11
|
+
) {
|
12
|
+
|
13
|
+
# Workaround http://projects.puppetlabs.com/issues/9848
|
14
|
+
$home_path = $home ? { '' => "/home/${user}", default => $home }
|
15
|
+
$root_path = $root ? { '' => "${home_path}/.rbenv", default => $root }
|
16
|
+
|
17
|
+
if ! defined( Exec["rbenv::compile ${user} ${ruby}"] ) {
|
18
|
+
fail("Rbenv-Ruby ${ruby} for user ${user} not found in catalog")
|
19
|
+
}
|
20
|
+
|
21
|
+
rbenvgem {"${user}/${ruby}/${gem}/${ensure}":
|
22
|
+
ensure => $ensure,
|
23
|
+
user => $user,
|
24
|
+
gemname => $gem,
|
25
|
+
ruby => $ruby,
|
26
|
+
rbenv => "${root_path}/versions/${ruby}",
|
27
|
+
require => Exec["rbenv::compile ${user} ${ruby}"],
|
28
|
+
}
|
29
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
define rbenv::install(
|
2
|
+
$user = $title,
|
3
|
+
$group = $user,
|
4
|
+
$home = '',
|
5
|
+
$root = '',
|
6
|
+
$rc = ".profile"
|
7
|
+
) {
|
8
|
+
|
9
|
+
# Workaround http://projects.puppetlabs.com/issues/9848
|
10
|
+
$home_path = $home ? { '' => "/home/${user}", default => $home }
|
11
|
+
$root_path = $root ? { '' => "${home_path}/.rbenv", default => $root }
|
12
|
+
|
13
|
+
$rbenvrc = "${home_path}/.rbenvrc"
|
14
|
+
$shrc = "${home_path}/${rc}"
|
15
|
+
|
16
|
+
if ! defined( Class['rbenv::dependencies'] ) {
|
17
|
+
require rbenv::dependencies
|
18
|
+
}
|
19
|
+
|
20
|
+
exec { "rbenv::checkout ${user}":
|
21
|
+
command => "git clone git://github.com/sstephenson/rbenv.git ${root_path}",
|
22
|
+
user => $user,
|
23
|
+
group => $group,
|
24
|
+
creates => $root_path,
|
25
|
+
path => ['/usr/bin', '/usr/sbin'],
|
26
|
+
timeout => 100,
|
27
|
+
cwd => $home_path,
|
28
|
+
require => Package['git'],
|
29
|
+
}
|
30
|
+
|
31
|
+
file { "rbenv::rbenvrc ${user}":
|
32
|
+
path => $rbenvrc,
|
33
|
+
owner => $user,
|
34
|
+
group => $group,
|
35
|
+
content => template('rbenv/dot.rbenvrc.erb'),
|
36
|
+
require => Exec["rbenv::checkout ${user}"],
|
37
|
+
}
|
38
|
+
|
39
|
+
exec { "rbenv::shrc ${user}":
|
40
|
+
command => "echo 'source ${rbenvrc}' >> ${shrc}",
|
41
|
+
user => $user,
|
42
|
+
group => $group,
|
43
|
+
unless => "grep -q rbenvrc ${shrc}",
|
44
|
+
path => ['/bin', '/usr/bin', '/usr/sbin'],
|
45
|
+
require => File["rbenv::rbenvrc ${user}"],
|
46
|
+
}
|
47
|
+
|
48
|
+
file { "rbenv::cache-dir ${user}":
|
49
|
+
owner => $user,
|
50
|
+
group => $group,
|
51
|
+
ensure => directory,
|
52
|
+
path => "${root_path}/cache",
|
53
|
+
require => Exec["rbenv::checkout ${user}"]
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
define rbenv::plugin::rbenvvars(
|
2
|
+
$user = $title,
|
3
|
+
$source = 'git://github.com/sstephenson/rbenv-vars.git',
|
4
|
+
$group = $user,
|
5
|
+
$home = '',
|
6
|
+
$root = ''
|
7
|
+
) {
|
8
|
+
rbenv::plugin { "rbenv::plugin::rbenvvars::${user}":
|
9
|
+
user => $user,
|
10
|
+
source => $source,
|
11
|
+
plugin_name => 'rbenv-vars',
|
12
|
+
group => $group,
|
13
|
+
home => $home,
|
14
|
+
root => $root
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
define rbenv::plugin::rubybuild(
|
2
|
+
$user = $title,
|
3
|
+
$source = 'git://github.com/sstephenson/ruby-build.git',
|
4
|
+
$group = $user,
|
5
|
+
$home = '',
|
6
|
+
$root = ''
|
7
|
+
) {
|
8
|
+
rbenv::plugin { "rbenv::plugin::rubybuild::${user}":
|
9
|
+
user => $user,
|
10
|
+
source => $source,
|
11
|
+
plugin_name => 'ruby-build',
|
12
|
+
group => $group,
|
13
|
+
home => $home,
|
14
|
+
root => $root
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
define rbenv::plugin(
|
2
|
+
$user,
|
3
|
+
$source,
|
4
|
+
$plugin_name = $title,
|
5
|
+
$group = $user,
|
6
|
+
$home = '',
|
7
|
+
$root = '',
|
8
|
+
$timeout = 100
|
9
|
+
) {
|
10
|
+
|
11
|
+
$home_path = $home ? { '' => "/home/${user}", default => $home }
|
12
|
+
$root_path = $root ? { '' => "${home_path}/.rbenv", default => $root }
|
13
|
+
$plugins = "${root_path}/plugins"
|
14
|
+
$destination = "${plugins}/${plugin_name}"
|
15
|
+
|
16
|
+
if $source !~ /^git:/ {
|
17
|
+
fail('Only git plugins are supported')
|
18
|
+
}
|
19
|
+
|
20
|
+
if ! defined(File["rbenv::plugins ${user}"]) {
|
21
|
+
file { "rbenv::plugins ${user}":
|
22
|
+
ensure => directory,
|
23
|
+
path => $plugins,
|
24
|
+
owner => $user,
|
25
|
+
group => $group,
|
26
|
+
require => Exec["rbenv::checkout ${user}"],
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
exec { "rbenv::plugin::checkout ${user} ${plugin_name}":
|
31
|
+
command => "git clone ${source} ${destination}",
|
32
|
+
user => $user,
|
33
|
+
group => $group,
|
34
|
+
creates => $destination,
|
35
|
+
path => ['/usr/bin', '/usr/sbin'],
|
36
|
+
timeout => $timeout,
|
37
|
+
cwd => $home_path,
|
38
|
+
require => File["rbenv::plugins ${user}"],
|
39
|
+
}
|
40
|
+
}
|
data/modules/rbenv/metadata.json
CHANGED
@@ -1,41 +1,109 @@
|
|
1
1
|
{
|
2
|
-
"name": "
|
3
|
-
"version": "1.0
|
4
|
-
"source": "
|
5
|
-
"author": "
|
2
|
+
"name": "alup-rbenv",
|
3
|
+
"version": "1.2.0",
|
4
|
+
"source": "UNKNOWN",
|
5
|
+
"author": "alup",
|
6
6
|
"license": "MIT",
|
7
|
-
"summary": "
|
8
|
-
"description": "
|
9
|
-
"project_page": "https://github.com/
|
7
|
+
"summary": "rbenv Ruby Version Manager module",
|
8
|
+
"description": "Puppet module for rbenv Ruby Version Manager",
|
9
|
+
"project_page": "https://github.com/alup/puppet-rbenv",
|
10
10
|
"dependencies": [
|
11
11
|
|
12
12
|
],
|
13
13
|
"types": [
|
14
|
-
|
14
|
+
{
|
15
|
+
"name": "rbenvgem",
|
16
|
+
"doc": "A Ruby Gem installed inside an rbenv-installed Ruby",
|
17
|
+
"properties": [
|
18
|
+
{
|
19
|
+
"name": "ensure",
|
20
|
+
"doc": " Valid values are `present` (also called `installed`), `absent`, `latest`. Values can match `/./`."
|
21
|
+
}
|
22
|
+
],
|
23
|
+
"parameters": [
|
24
|
+
{
|
25
|
+
"name": "name",
|
26
|
+
"doc": "Gem qualified name within an rbenv repository"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"name": "gemname",
|
30
|
+
"doc": "The Gem name"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"name": "ruby",
|
34
|
+
"doc": "The ruby interpreter version"
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"name": "rbenv",
|
38
|
+
"doc": "The rbenv root"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"name": "user",
|
42
|
+
"doc": "The rbenv owner"
|
43
|
+
}
|
44
|
+
],
|
45
|
+
"providers": [
|
46
|
+
{
|
47
|
+
"name": "default",
|
48
|
+
"doc": "Maintains gems inside an RBenv setup\n\nRequired binaries: `su`."
|
49
|
+
}
|
50
|
+
]
|
51
|
+
}
|
15
52
|
],
|
16
53
|
"checksums": {
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"Gemfile
|
20
|
-
"
|
21
|
-
"Modulefile": "
|
22
|
-
"README.md": "
|
23
|
-
"Rakefile": "
|
24
|
-
"
|
25
|
-
"
|
26
|
-
"
|
27
|
-
"
|
28
|
-
"
|
29
|
-
"
|
30
|
-
"
|
31
|
-
"
|
32
|
-
"
|
33
|
-
"
|
34
|
-
"
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
39
|
-
"
|
54
|
+
"AUTHORS": "41bce6ef435e4c4fb01a3c7662477d58",
|
55
|
+
"CHANGELOG.md": "d075b1f284329fff6d5175dbb3278cbc",
|
56
|
+
"Gemfile": "f68769c7bd5266f1a4de0607fd78d17a",
|
57
|
+
"Gemfile.lock": "571d1b5c4b633773b97a88c8a2974581",
|
58
|
+
"Modulefile": "3bb3b412457d726bb0a7318ac4562fa4",
|
59
|
+
"README.md": "09fcaeb15a0ad5096f1c6f1ff6e999fb",
|
60
|
+
"Rakefile": "7bb6178549213331858bf2512a4f6a17",
|
61
|
+
"TODO": "829d2a329bf2974b9d8af868cf35db94",
|
62
|
+
"bin/autospec": "d4fde3f4a9f1e5fd339228026654cb70",
|
63
|
+
"bin/facter": "54901e1d789da4ff3303d45a6d66fc03",
|
64
|
+
"bin/filebucket": "770eee5e0fb7f1013abce8041bc9d407",
|
65
|
+
"bin/hiera": "60a41938163cc8af0b56456abcbdfcd3",
|
66
|
+
"bin/htmldiff": "8d551a540666732a11d6caa9aa3a0e68",
|
67
|
+
"bin/ldiff": "3104dda81ce6a8c0bf122df6ac851365",
|
68
|
+
"bin/pi": "b72c410b2de13e2f58526a53cdd8c6b2",
|
69
|
+
"bin/puppet": "5349ed70b05332a13b83ba8077dd0043",
|
70
|
+
"bin/puppet-lint": "7f9089954f23d779e8ce05a4a53cf440",
|
71
|
+
"bin/puppet-module": "5598cb513ff52a621e80d124010ddccb",
|
72
|
+
"bin/puppetca": "bc1f6643a1f5752c10f9cd1d967f6339",
|
73
|
+
"bin/puppetd": "90205a5cf917d78fd2be85a565b7fbc5",
|
74
|
+
"bin/puppetdoc": "93170c3ea411bce6d11d8d6fc96bdf49",
|
75
|
+
"bin/puppetmasterd": "dd139c09d5e3f04c103f4ba80221432d",
|
76
|
+
"bin/puppetqd": "f3e6ac649b6e2b9f637dee3c7e6c8c1e",
|
77
|
+
"bin/puppetrun": "de8fea72006efd65a4efd0c092e6dd39",
|
78
|
+
"bin/rake": "d09495e1a29ed0015941718d92deb28b",
|
79
|
+
"bin/ralsh": "ac7d134c175adfdd682f5b73b157e81e",
|
80
|
+
"bin/rspec": "00ed29f02ccbfaf09483109846c4a9c3",
|
81
|
+
"bin/rspec-puppet-init": "6cd42b0ad1382d8a870c1f75caf67a50",
|
82
|
+
"lib/puppet/provider/rbenvgem/default.rb": "e4f6ccda50b6b34aa1cacbb565082fa0",
|
83
|
+
"lib/puppet/type/rbenvgem.rb": "a3d2f7f9e4ce273d2d58ac86a59377c5",
|
84
|
+
"manifests/bundle.pp": "352b95944faacc82cfb15ef3e8eadd36",
|
85
|
+
"manifests/client.pp": "c6be48e076e539dfb67f64fa20dc26d6",
|
86
|
+
"manifests/compile.pp": "050f1bedccea7e4bf060baa002bf9e93",
|
87
|
+
"manifests/definition.pp": "1cfd81042f40aaf34dbb32936c2a3a3a",
|
88
|
+
"manifests/dependencies/centos.pp": "71057409e9760e3d53ad7f2a9d862874",
|
89
|
+
"manifests/dependencies/suse.pp": "fe7e6bffa09f1bc30f21f77e9c911ada",
|
90
|
+
"manifests/dependencies/ubuntu.pp": "803d58aabe0f752e5e1182b15f1991fe",
|
91
|
+
"manifests/dependencies.pp": "3a23ca0524928ae39396c451d938319e",
|
92
|
+
"manifests/gem.pp": "d4614ec9f988e707ad7b852169cb9e20",
|
93
|
+
"manifests/install.pp": "93f1a0ff0cb1b2845567871299161d79",
|
94
|
+
"manifests/plugin/rbenvvars.pp": "e9f977b7d5f4c1af85f65b60e04bf145",
|
95
|
+
"manifests/plugin/rubybuild.pp": "d8f5df37e2e4f0dbd83145f7cdabf79f",
|
96
|
+
"manifests/plugin.pp": "cd89bbf44c3418fefb26a49117957617",
|
97
|
+
"spec/classes/dependencies_spec.rb": "6f39406d29bb15e4e2b9155ae09f0daf",
|
98
|
+
"spec/defines/rbenv__compile_spec.rb": "b9e07a69c8cd7acbd887fdfba870ddd8",
|
99
|
+
"spec/defines/rbenv__definition_spec.rb": "a94134d4a5be5f021ae53489398f74a3",
|
100
|
+
"spec/defines/rbenv__install_spec.rb": "044888bc54fc109eb0c22619bca86ffb",
|
101
|
+
"spec/defines/rbenv__plugin__rbenvvars_spec.rb": "781cdf9a2a0e0f466636d981d19034b0",
|
102
|
+
"spec/defines/rbenv__plugin__rubybuild_spec.rb": "24132e11ad1558227175280ee8fda08f",
|
103
|
+
"spec/defines/rbenv__plugin_spec.rb": "0b172008a61009ceac28625f4788ff4b",
|
104
|
+
"spec/fixtures/manifests/site.pp": "d41d8cd98f00b204e9800998ecf8427e",
|
105
|
+
"spec/spec_helper.rb": "d5f3f46cba1721d2ad62fe96aad002c6",
|
106
|
+
"templates/Gemfile.erb": "c1b501d75ff589a4d2f54c1fc2674283",
|
107
|
+
"templates/dot.rbenvrc.erb": "dc88eda08086172606be9e1b4b87d90e"
|
40
108
|
}
|
41
109
|
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'rbenv::dependencies' do
|
4
|
+
let(:title) { 'rbenv::dependencies' }
|
5
|
+
|
6
|
+
context 'Ubuntu' do
|
7
|
+
let(:facts) { {:osfamily => 'debian'} }
|
8
|
+
it { should include_class('rbenv::dependencies::ubuntu') }
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'RedHat' do
|
12
|
+
let(:facts) { {:osfamily => 'redhat'} }
|
13
|
+
it { should include_class('rbenv::dependencies::centos') }
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'Suse' do
|
17
|
+
let(:facts) { {:osfamily => 'suse'} }
|
18
|
+
it { should include_class('rbenv::dependencies::suse') }
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'rbenv::compile', :type => :define do
|
4
|
+
let(:user) { 'tester' }
|
5
|
+
let(:ruby_version) { '1.9.3-p125' }
|
6
|
+
let(:title) { "rbenv::compile::#{user}::#{ruby_version}" }
|
7
|
+
let(:dot_rbenv) { "/home/#{user}/.rbenv" }
|
8
|
+
let(:params) { {:user => user, :ruby => ruby_version, :global => true} }
|
9
|
+
|
10
|
+
it "installs ruby of the chosen version" do
|
11
|
+
should contain_exec("rbenv::compile #{user} #{ruby_version}").
|
12
|
+
with_command("rbenv install #{ruby_version} && touch #{dot_rbenv}/.rehash")
|
13
|
+
end
|
14
|
+
|
15
|
+
it "issues a rehash command" do
|
16
|
+
should contain_exec("rbenv::rehash #{user} #{ruby_version}").
|
17
|
+
with_command("rbenv rehash && rm -f #{dot_rbenv}/.rehash")
|
18
|
+
end
|
19
|
+
|
20
|
+
it "sets the global ruby version for the specific user" do
|
21
|
+
should contain_file("rbenv::global #{user}").
|
22
|
+
with_content("#{ruby_version}\n").
|
23
|
+
with_require("Exec[rbenv::compile #{user} #{ruby_version}]")
|
24
|
+
end
|
25
|
+
|
26
|
+
it "installs ruby-build plugin from official repository" do
|
27
|
+
should contain_rbenv__plugin__rubybuild("rbenv::rubybuild::#{user}")
|
28
|
+
end
|
29
|
+
|
30
|
+
it "installs bundler" do
|
31
|
+
should contain_rbenv__gem("rbenv::bundler #{user} #{ruby_version}").
|
32
|
+
with_ensure('present')
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'rbenv::definition', :type => :define do
|
4
|
+
let(:user) { 'tester' }
|
5
|
+
let(:ruby_version) { '1.9.3-p125' }
|
6
|
+
let(:title) { "rbenv::definition::#{user}::#{ruby_version}" }
|
7
|
+
let(:dot_rbenv) { "/home/#{user}/.rbenv" }
|
8
|
+
let(:target_path) { "#{dot_rbenv}/plugins/ruby-build/share/ruby-build/#{ruby_version}" }
|
9
|
+
let(:params) { {:user => user, :ruby => ruby_version, :source => definition} }
|
10
|
+
|
11
|
+
context 'puppet' do
|
12
|
+
let(:definition) { 'puppet:///custom-definition' }
|
13
|
+
it 'copies the file to the right path' do
|
14
|
+
should contain_file("rbenv::definition-file #{user} #{ruby_version}").with(
|
15
|
+
:path => target_path,
|
16
|
+
:source => definition
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'http' do
|
22
|
+
let(:definition) { 'http://gist.com/ree' }
|
23
|
+
it 'downloads file to the right path' do
|
24
|
+
should contain_exec("rbenv::definition-file #{user} #{ruby_version}").with(
|
25
|
+
:command => "wget #{definition} -O #{target_path}",
|
26
|
+
:creates => target_path
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'https' do
|
32
|
+
let(:definition) { 'https://gist.com/ree' }
|
33
|
+
it 'downloads file to the right path' do
|
34
|
+
should contain_exec("rbenv::definition-file #{user} #{ruby_version}").with(
|
35
|
+
:command => "wget #{definition} -O #{target_path}",
|
36
|
+
:creates => target_path
|
37
|
+
)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'rbenv::install', :type => :define do
|
4
|
+
let(:user) { 'tester' }
|
5
|
+
let(:title) { "rbenv::install::#{user}" }
|
6
|
+
let(:params) { {:user => user} }
|
7
|
+
|
8
|
+
context 'install rbenv' do
|
9
|
+
it "clones rbenv from the official repository" do
|
10
|
+
should contain_exec("rbenv::checkout #{user}").
|
11
|
+
with_command("git clone git://github.com/sstephenson/rbenv.git /home/#{user}/.rbenv")
|
12
|
+
end
|
13
|
+
|
14
|
+
it "appends in a rc file, a command to include .rbenv/bin folder in PATH env variable" do
|
15
|
+
should contain_exec("rbenv::shrc #{user}").
|
16
|
+
with_command("echo 'source /home/#{user}/.rbenvrc' >> /home/#{user}/.profile")
|
17
|
+
end
|
18
|
+
|
19
|
+
it "creates a cache folder" do
|
20
|
+
should contain_file("rbenv::cache-dir #{user}").
|
21
|
+
with(:ensure => "directory", :path => "/home/#{user}/.rbenv/cache")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'rbenv::plugin::rbenvvars', :type => :define do
|
4
|
+
let(:user) { 'tester' }
|
5
|
+
let(:title) { user }
|
6
|
+
|
7
|
+
it {
|
8
|
+
should contain_rbenv__plugin("rbenv::plugin::rbenvvars::#{user}").with(
|
9
|
+
:plugin_name => 'rbenv-vars',
|
10
|
+
:source => 'git://github.com/sstephenson/rbenv-vars.git',
|
11
|
+
:user => user
|
12
|
+
)
|
13
|
+
}
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'rbenv::plugin::rubybuild', :type => :define do
|
4
|
+
let(:user) { 'tester' }
|
5
|
+
let(:title) { user }
|
6
|
+
|
7
|
+
it {
|
8
|
+
should contain_rbenv__plugin("rbenv::plugin::rubybuild::#{user}").with(
|
9
|
+
:plugin_name => 'ruby-build',
|
10
|
+
:source => 'git://github.com/sstephenson/ruby-build.git',
|
11
|
+
:user => user
|
12
|
+
)
|
13
|
+
}
|
14
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'rbenv::plugin', :type => :define do
|
4
|
+
let(:user) { 'tester' }
|
5
|
+
let(:plugin_name) { 'rbenv-vars' }
|
6
|
+
let(:dot_rbenv) { "/home/#{user}/.rbenv" }
|
7
|
+
let(:source) { 'git://github.com/rbenv/plugin' }
|
8
|
+
let(:title) { "rbenv::plugin::#{user}::#{plugin_name}" }
|
9
|
+
let(:params) { {:user => user, :plugin_name => plugin_name, :source => source} }
|
10
|
+
|
11
|
+
let(:target_path) { "#{dot_rbenv}/plugins/#{plugin_name}" }
|
12
|
+
|
13
|
+
it 'clones repository to the right path' do
|
14
|
+
should contain_exec("rbenv::plugin::checkout #{user} #{plugin_name}").with(
|
15
|
+
:command => "git clone #{source} #{target_path}",
|
16
|
+
:user => user,
|
17
|
+
:creates => target_path,
|
18
|
+
:require => /rbenv::plugins #{user}/
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'with source != git' do
|
23
|
+
let(:source) { 'something != git' }
|
24
|
+
|
25
|
+
it 'fails informing that it is not supported yet' do
|
26
|
+
expect {
|
27
|
+
should contain_exec("rbenv::plugin::checkout #{user} #{plugin_name}")
|
28
|
+
}.to raise_error(Puppet::Error, /Only git plugins are supported/)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
File without changes
|
@@ -1 +1,6 @@
|
|
1
|
-
require '
|
1
|
+
require 'rspec-puppet'
|
2
|
+
|
3
|
+
RSpec.configure do |c|
|
4
|
+
c.module_path = File.expand_path(File.join(__FILE__, '..', 'fixtures', 'modules'))
|
5
|
+
c.manifest_dir = File.expand_path(File.join(__FILE__, '..', 'fixtures', 'manifests'))
|
6
|
+
end
|