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,464 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'apache', :type => :class do
|
4
|
+
context "on a Debian OS" do
|
5
|
+
let :facts do
|
6
|
+
{
|
7
|
+
:osfamily => 'Debian',
|
8
|
+
:operatingsystemrelease => '6',
|
9
|
+
:concat_basedir => '/dne',
|
10
|
+
}
|
11
|
+
end
|
12
|
+
it { should contain_class("apache::params") }
|
13
|
+
it { should contain_package("httpd").with(
|
14
|
+
'notify' => 'Class[Apache::Service]',
|
15
|
+
'ensure' => 'installed'
|
16
|
+
)
|
17
|
+
}
|
18
|
+
it { should contain_user("www-data") }
|
19
|
+
it { should contain_group("www-data") }
|
20
|
+
it { should contain_class("apache::service") }
|
21
|
+
it { should contain_file("/etc/apache2/sites-enabled").with(
|
22
|
+
'ensure' => 'directory',
|
23
|
+
'recurse' => 'true',
|
24
|
+
'purge' => 'true',
|
25
|
+
'notify' => 'Class[Apache::Service]',
|
26
|
+
'require' => 'Package[httpd]'
|
27
|
+
)
|
28
|
+
}
|
29
|
+
it { should contain_file("/etc/apache2/mods-enabled").with(
|
30
|
+
'ensure' => 'directory',
|
31
|
+
'recurse' => 'true',
|
32
|
+
'purge' => 'true',
|
33
|
+
'notify' => 'Class[Apache::Service]',
|
34
|
+
'require' => 'Package[httpd]'
|
35
|
+
)
|
36
|
+
}
|
37
|
+
it { should contain_file("/etc/apache2/mods-available").with(
|
38
|
+
'ensure' => 'directory',
|
39
|
+
'recurse' => 'true',
|
40
|
+
'purge' => 'true',
|
41
|
+
'notify' => 'Class[Apache::Service]',
|
42
|
+
'require' => 'Package[httpd]'
|
43
|
+
)
|
44
|
+
}
|
45
|
+
it { should contain_concat("/etc/apache2/ports.conf").with(
|
46
|
+
'owner' => 'root',
|
47
|
+
'group' => 'root',
|
48
|
+
'mode' => '0644',
|
49
|
+
'notify' => 'Class[Apache::Service]'
|
50
|
+
)
|
51
|
+
}
|
52
|
+
# Assert that load files are placed and symlinked for these mods, but no conf file.
|
53
|
+
[
|
54
|
+
'auth_basic',
|
55
|
+
'authn_file',
|
56
|
+
'authz_default',
|
57
|
+
'authz_groupfile',
|
58
|
+
'authz_host',
|
59
|
+
'authz_user',
|
60
|
+
'dav',
|
61
|
+
'env'
|
62
|
+
].each do |modname|
|
63
|
+
it { should contain_file("#{modname}.load").with(
|
64
|
+
'path' => "/etc/apache2/mods-available/#{modname}.load",
|
65
|
+
'ensure' => 'file'
|
66
|
+
) }
|
67
|
+
it { should contain_file("#{modname}.load symlink").with(
|
68
|
+
'path' => "/etc/apache2/mods-enabled/#{modname}.load",
|
69
|
+
'ensure' => 'link',
|
70
|
+
'target' => "/etc/apache2/mods-available/#{modname}.load"
|
71
|
+
) }
|
72
|
+
it { should_not contain_file("#{modname}.conf") }
|
73
|
+
it { should_not contain_file("#{modname}.conf symlink") }
|
74
|
+
end
|
75
|
+
|
76
|
+
# Assert that both load files and conf files are placed and symlinked for these mods
|
77
|
+
[
|
78
|
+
'alias',
|
79
|
+
'autoindex',
|
80
|
+
'dav_fs',
|
81
|
+
'deflate',
|
82
|
+
'dir',
|
83
|
+
'mime',
|
84
|
+
'negotiation',
|
85
|
+
'setenvif',
|
86
|
+
].each do |modname|
|
87
|
+
it { should contain_file("#{modname}.load").with(
|
88
|
+
'path' => "/etc/apache2/mods-available/#{modname}.load",
|
89
|
+
'ensure' => 'file'
|
90
|
+
) }
|
91
|
+
it { should contain_file("#{modname}.load symlink").with(
|
92
|
+
'path' => "/etc/apache2/mods-enabled/#{modname}.load",
|
93
|
+
'ensure' => 'link',
|
94
|
+
'target' => "/etc/apache2/mods-available/#{modname}.load"
|
95
|
+
) }
|
96
|
+
it { should contain_file("#{modname}.conf").with(
|
97
|
+
'path' => "/etc/apache2/mods-available/#{modname}.conf",
|
98
|
+
'ensure' => 'file'
|
99
|
+
) }
|
100
|
+
it { should contain_file("#{modname}.conf symlink").with(
|
101
|
+
'path' => "/etc/apache2/mods-enabled/#{modname}.conf",
|
102
|
+
'ensure' => 'link',
|
103
|
+
'target' => "/etc/apache2/mods-available/#{modname}.conf"
|
104
|
+
) }
|
105
|
+
end
|
106
|
+
describe "Don't create user resource" do
|
107
|
+
context "when parameter manage_user is false" do
|
108
|
+
let :params do
|
109
|
+
{ :manage_user => false }
|
110
|
+
end
|
111
|
+
|
112
|
+
it { should_not contain_user('www-data') }
|
113
|
+
it { should contain_file("/etc/apache2/apache2.conf").with_content %r{^User www-data\n} }
|
114
|
+
end
|
115
|
+
end
|
116
|
+
describe "Don't create group resource" do
|
117
|
+
context "when parameter manage_group is false" do
|
118
|
+
let :params do
|
119
|
+
{ :manage_group => false }
|
120
|
+
end
|
121
|
+
|
122
|
+
it { should_not contain_group('www-data') }
|
123
|
+
it { should contain_file("/etc/apache2/apache2.conf").with_content %r{^Group www-data\n} }
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
context "on a RedHat 5 OS" do
|
128
|
+
let :facts do
|
129
|
+
{
|
130
|
+
:osfamily => 'RedHat',
|
131
|
+
:operatingsystemrelease => '5',
|
132
|
+
:concat_basedir => '/dne',
|
133
|
+
}
|
134
|
+
end
|
135
|
+
it { should contain_class("apache::params") }
|
136
|
+
it { should contain_package("httpd").with(
|
137
|
+
'notify' => 'Class[Apache::Service]',
|
138
|
+
'ensure' => 'installed'
|
139
|
+
)
|
140
|
+
}
|
141
|
+
it { should contain_user("apache") }
|
142
|
+
it { should contain_group("apache") }
|
143
|
+
it { should contain_class("apache::service") }
|
144
|
+
it { should contain_file("/etc/httpd/conf.d").with(
|
145
|
+
'ensure' => 'directory',
|
146
|
+
'recurse' => 'true',
|
147
|
+
'purge' => 'true',
|
148
|
+
'notify' => 'Class[Apache::Service]',
|
149
|
+
'require' => 'Package[httpd]'
|
150
|
+
)
|
151
|
+
}
|
152
|
+
it { should contain_concat("/etc/httpd/conf/ports.conf").with(
|
153
|
+
'owner' => 'root',
|
154
|
+
'group' => 'root',
|
155
|
+
'mode' => '0644',
|
156
|
+
'notify' => 'Class[Apache::Service]'
|
157
|
+
)
|
158
|
+
}
|
159
|
+
describe "Alternate confd/mod/vhosts directory" do
|
160
|
+
let :params do
|
161
|
+
{
|
162
|
+
:vhost_dir => '/etc/httpd/site.d',
|
163
|
+
:confd_dir => '/etc/httpd/conf.d',
|
164
|
+
:mod_dir => '/etc/httpd/mod.d',
|
165
|
+
}
|
166
|
+
end
|
167
|
+
|
168
|
+
['mod.d','site.d','conf.d'].each do |dir|
|
169
|
+
it { should contain_file("/etc/httpd/#{dir}").with(
|
170
|
+
'ensure' => 'directory',
|
171
|
+
'recurse' => 'true',
|
172
|
+
'purge' => 'true',
|
173
|
+
'notify' => 'Class[Apache::Service]',
|
174
|
+
'require' => 'Package[httpd]'
|
175
|
+
) }
|
176
|
+
end
|
177
|
+
|
178
|
+
# Assert that load files are placed for these mods, but no conf file.
|
179
|
+
[
|
180
|
+
'auth_basic',
|
181
|
+
'authn_file',
|
182
|
+
'authz_default',
|
183
|
+
'authz_groupfile',
|
184
|
+
'authz_host',
|
185
|
+
'authz_user',
|
186
|
+
'dav',
|
187
|
+
'env',
|
188
|
+
].each do |modname|
|
189
|
+
it { should contain_file("#{modname}.load").with_path(
|
190
|
+
"/etc/httpd/mod.d/#{modname}.load"
|
191
|
+
) }
|
192
|
+
it { should_not contain_file("#{modname}.conf").with_path(
|
193
|
+
"/etc/httpd/mod.d/#{modname}.conf"
|
194
|
+
) }
|
195
|
+
end
|
196
|
+
|
197
|
+
# Assert that both load files and conf files are placed for these mods
|
198
|
+
[
|
199
|
+
'alias',
|
200
|
+
'autoindex',
|
201
|
+
'dav_fs',
|
202
|
+
'deflate',
|
203
|
+
'dir',
|
204
|
+
'mime',
|
205
|
+
'negotiation',
|
206
|
+
'setenvif',
|
207
|
+
].each do |modname|
|
208
|
+
it { should contain_file("#{modname}.load").with_path(
|
209
|
+
"/etc/httpd/mod.d/#{modname}.load"
|
210
|
+
) }
|
211
|
+
it { should contain_file("#{modname}.conf").with_path(
|
212
|
+
"/etc/httpd/mod.d/#{modname}.conf"
|
213
|
+
) }
|
214
|
+
end
|
215
|
+
|
216
|
+
it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include /etc/httpd/conf\.d/\*\.conf$} }
|
217
|
+
it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include /etc/httpd/site\.d/\*\.conf$} }
|
218
|
+
it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include /etc/httpd/mod\.d/\*\.conf$} }
|
219
|
+
it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include /etc/httpd/mod\.d/\*\.load$} }
|
220
|
+
end
|
221
|
+
|
222
|
+
describe "Alternate conf.d directory" do
|
223
|
+
let :params do
|
224
|
+
{ :confd_dir => '/etc/httpd/special_conf.d' }
|
225
|
+
end
|
226
|
+
|
227
|
+
it { should contain_file("/etc/httpd/special_conf.d").with(
|
228
|
+
'ensure' => 'directory',
|
229
|
+
'recurse' => 'true',
|
230
|
+
'purge' => 'true',
|
231
|
+
'notify' => 'Class[Apache::Service]',
|
232
|
+
'require' => 'Package[httpd]'
|
233
|
+
) }
|
234
|
+
end
|
235
|
+
|
236
|
+
describe "Alternate mpm_modules" do
|
237
|
+
context "when declaring mpm_module is false" do
|
238
|
+
let :params do
|
239
|
+
{ :mpm_module => false }
|
240
|
+
end
|
241
|
+
it 'should not declare mpm modules' do
|
242
|
+
should_not contain_class('apache::mod::event')
|
243
|
+
should_not contain_class('apache::mod::itk')
|
244
|
+
should_not contain_class('apache::mod::peruser')
|
245
|
+
should_not contain_class('apache::mod::prefork')
|
246
|
+
should_not contain_class('apache::mod::worker')
|
247
|
+
end
|
248
|
+
end
|
249
|
+
context "when declaring mpm_module => prefork" do
|
250
|
+
let :params do
|
251
|
+
{ :mpm_module => 'prefork' }
|
252
|
+
end
|
253
|
+
it { should contain_class('apache::mod::prefork') }
|
254
|
+
it { should_not contain_class('apache::mod::event') }
|
255
|
+
it { should_not contain_class('apache::mod::itk') }
|
256
|
+
it { should_not contain_class('apache::mod::peruser') }
|
257
|
+
it { should_not contain_class('apache::mod::worker') }
|
258
|
+
end
|
259
|
+
context "when declaring mpm_module => worker" do
|
260
|
+
let :params do
|
261
|
+
{ :mpm_module => 'worker' }
|
262
|
+
end
|
263
|
+
it { should contain_class('apache::mod::worker') }
|
264
|
+
it { should_not contain_class('apache::mod::event') }
|
265
|
+
it { should_not contain_class('apache::mod::itk') }
|
266
|
+
it { should_not contain_class('apache::mod::peruser') }
|
267
|
+
it { should_not contain_class('apache::mod::prefork') }
|
268
|
+
end
|
269
|
+
context "when declaring mpm_module => breakme" do
|
270
|
+
let :params do
|
271
|
+
{ :mpm_module => 'breakme' }
|
272
|
+
end
|
273
|
+
it { expect { subject }.to raise_error Puppet::Error, /does not match/ }
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
describe "different templates for httpd.conf" do
|
278
|
+
context "with default" do
|
279
|
+
let :params do
|
280
|
+
{ :conf_template => 'apache/httpd.conf.erb' }
|
281
|
+
end
|
282
|
+
it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^# Security\n} }
|
283
|
+
end
|
284
|
+
context "with non-default" do
|
285
|
+
let :params do
|
286
|
+
{ :conf_template => 'site_apache/fake.conf.erb' }
|
287
|
+
end
|
288
|
+
it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Fake template for rspec.$} }
|
289
|
+
end
|
290
|
+
end
|
291
|
+
|
292
|
+
describe "default mods" do
|
293
|
+
context "without" do
|
294
|
+
let :params do
|
295
|
+
{ :default_mods => false }
|
296
|
+
end
|
297
|
+
|
298
|
+
it { should contain_apache__mod('authz_host') }
|
299
|
+
it { should_not contain_apache__mod('env') }
|
300
|
+
end
|
301
|
+
context "custom" do
|
302
|
+
let :params do
|
303
|
+
{ :default_mods => [
|
304
|
+
'info',
|
305
|
+
'alias',
|
306
|
+
'mime',
|
307
|
+
'env',
|
308
|
+
'setenv',
|
309
|
+
'expires',
|
310
|
+
]}
|
311
|
+
end
|
312
|
+
|
313
|
+
it { should contain_apache__mod('authz_host') }
|
314
|
+
it { should contain_apache__mod('env') }
|
315
|
+
it { should contain_class('apache::mod::info') }
|
316
|
+
it { should contain_class('apache::mod::mime') }
|
317
|
+
end
|
318
|
+
end
|
319
|
+
describe "Don't create user resource" do
|
320
|
+
context "when parameter manage_user is false" do
|
321
|
+
let :params do
|
322
|
+
{ :manage_user => false }
|
323
|
+
end
|
324
|
+
|
325
|
+
it { should_not contain_user('apache') }
|
326
|
+
it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^User apache\n} }
|
327
|
+
end
|
328
|
+
end
|
329
|
+
describe "Don't create group resource" do
|
330
|
+
context "when parameter manage_group is false" do
|
331
|
+
let :params do
|
332
|
+
{ :manage_group => false }
|
333
|
+
end
|
334
|
+
|
335
|
+
it { should_not contain_group('apache') }
|
336
|
+
it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Group apache\n} }
|
337
|
+
|
338
|
+
end
|
339
|
+
end
|
340
|
+
describe "sendfile" do
|
341
|
+
context "with invalid value" do
|
342
|
+
let :params do
|
343
|
+
{ :sendfile => 'foo' }
|
344
|
+
end
|
345
|
+
it "should fail" do
|
346
|
+
expect do
|
347
|
+
subject
|
348
|
+
end.to raise_error(Puppet::Error, /"foo" does not match/)
|
349
|
+
end
|
350
|
+
end
|
351
|
+
context "On" do
|
352
|
+
let :params do
|
353
|
+
{ :sendfile => 'On' }
|
354
|
+
end
|
355
|
+
it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^EnableSendfile On\n} }
|
356
|
+
end
|
357
|
+
context "Off" do
|
358
|
+
let :params do
|
359
|
+
{ :sendfile => 'Off' }
|
360
|
+
end
|
361
|
+
it { should contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^EnableSendfile Off\n} }
|
362
|
+
end
|
363
|
+
end
|
364
|
+
end
|
365
|
+
context "on a FreeBSD OS" do
|
366
|
+
let :facts do
|
367
|
+
{
|
368
|
+
:osfamily => 'FreeBSD',
|
369
|
+
:operatingsystemrelease => '9',
|
370
|
+
:concat_basedir => '/dne',
|
371
|
+
}
|
372
|
+
end
|
373
|
+
it { should contain_class("apache::params") }
|
374
|
+
it { should contain_class("apache::package").with({'ensure' => 'present'}) }
|
375
|
+
it { should contain_user("www") }
|
376
|
+
it { should contain_group("www") }
|
377
|
+
it { should contain_class("apache::service") }
|
378
|
+
it { should contain_file("/usr/local/etc/apache22/Vhosts").with(
|
379
|
+
'ensure' => 'directory',
|
380
|
+
'recurse' => 'true',
|
381
|
+
'purge' => 'true',
|
382
|
+
'notify' => 'Class[Apache::Service]',
|
383
|
+
'require' => 'Package[httpd]'
|
384
|
+
) }
|
385
|
+
it { should contain_file("/usr/local/etc/apache22/Modules").with(
|
386
|
+
'ensure' => 'directory',
|
387
|
+
'recurse' => 'true',
|
388
|
+
'purge' => 'true',
|
389
|
+
'notify' => 'Class[Apache::Service]',
|
390
|
+
'require' => 'Package[httpd]'
|
391
|
+
) }
|
392
|
+
it { should contain_concat("/usr/local/etc/apache22/ports.conf").with(
|
393
|
+
'owner' => 'root',
|
394
|
+
'group' => 'wheel',
|
395
|
+
'mode' => '0644',
|
396
|
+
'notify' => 'Class[Apache::Service]'
|
397
|
+
) }
|
398
|
+
# Assert that load files are placed for these mods, but no conf file.
|
399
|
+
[
|
400
|
+
'auth_basic',
|
401
|
+
'authn_file',
|
402
|
+
'authz_default',
|
403
|
+
'authz_groupfile',
|
404
|
+
'authz_host',
|
405
|
+
'authz_user',
|
406
|
+
'dav',
|
407
|
+
'env'
|
408
|
+
].each do |modname|
|
409
|
+
it { should contain_file("#{modname}.load").with(
|
410
|
+
'path' => "/usr/local/etc/apache22/Modules/#{modname}.load",
|
411
|
+
'ensure' => 'file'
|
412
|
+
) }
|
413
|
+
it { should_not contain_file("#{modname}.conf") }
|
414
|
+
end
|
415
|
+
|
416
|
+
# Assert that both load files and conf files are placed for these mods
|
417
|
+
[
|
418
|
+
'alias',
|
419
|
+
'autoindex',
|
420
|
+
'dav_fs',
|
421
|
+
'deflate',
|
422
|
+
'dir',
|
423
|
+
'mime',
|
424
|
+
'negotiation',
|
425
|
+
'setenvif',
|
426
|
+
].each do |modname|
|
427
|
+
it { should contain_file("#{modname}.load").with(
|
428
|
+
'path' => "/usr/local/etc/apache22/Modules/#{modname}.load",
|
429
|
+
'ensure' => 'file'
|
430
|
+
) }
|
431
|
+
it { should contain_file("#{modname}.conf").with(
|
432
|
+
'path' => "/usr/local/etc/apache22/Modules/#{modname}.conf",
|
433
|
+
'ensure' => 'file'
|
434
|
+
) }
|
435
|
+
end
|
436
|
+
end
|
437
|
+
context 'on all OSes' do
|
438
|
+
let :facts do
|
439
|
+
{
|
440
|
+
:osfamily => 'RedHat',
|
441
|
+
:operatingsystemrelease => '6',
|
442
|
+
:concat_basedir => '/dne',
|
443
|
+
}
|
444
|
+
end
|
445
|
+
context 'default vhost defaults' do
|
446
|
+
it { should contain_apache__vhost('default').with_ensure('present') }
|
447
|
+
it { should contain_apache__vhost('default-ssl').with_ensure('absent') }
|
448
|
+
end
|
449
|
+
context 'without default non-ssl vhost' do
|
450
|
+
let :params do {
|
451
|
+
:default_vhost => false
|
452
|
+
}
|
453
|
+
end
|
454
|
+
it { should contain_apache__vhost('default').with_ensure('absent') }
|
455
|
+
end
|
456
|
+
context 'with default ssl vhost' do
|
457
|
+
let :params do {
|
458
|
+
:default_ssl_vhost => true
|
459
|
+
}
|
460
|
+
end
|
461
|
+
it { should contain_apache__vhost('default-ssl').with_ensure('present') }
|
462
|
+
end
|
463
|
+
end
|
464
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'apache::dev', :type => :class do
|
4
|
+
context "on a Debian OS" do
|
5
|
+
let :facts do
|
6
|
+
{
|
7
|
+
:osfamily => 'Debian',
|
8
|
+
:operatingsystemrelease => '6',
|
9
|
+
}
|
10
|
+
end
|
11
|
+
it { should contain_class("apache::params") }
|
12
|
+
it { should contain_package("libaprutil1-dev") }
|
13
|
+
it { should contain_package("libapr1-dev") }
|
14
|
+
it { should contain_package("apache2-prefork-dev") }
|
15
|
+
end
|
16
|
+
context "on a RedHat OS" do
|
17
|
+
let :facts do
|
18
|
+
{
|
19
|
+
:osfamily => 'RedHat',
|
20
|
+
:operatingsystemrelease => '6',
|
21
|
+
}
|
22
|
+
end
|
23
|
+
it { should contain_class("apache::params") }
|
24
|
+
it { should contain_package("httpd-devel") }
|
25
|
+
end
|
26
|
+
context "on a FreeBSD OS" do
|
27
|
+
let :pre_condition do
|
28
|
+
'include apache::package'
|
29
|
+
end
|
30
|
+
let :facts do
|
31
|
+
{
|
32
|
+
:osfamily => 'FreeBSD',
|
33
|
+
:operatingsystemrelease => '9',
|
34
|
+
}
|
35
|
+
end
|
36
|
+
it { should contain_class("apache::params") }
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
describe 'apache::mod::auth_kerb', :type => :class do
|
2
|
+
let :pre_condition do
|
3
|
+
'include apache'
|
4
|
+
end
|
5
|
+
context "on a Debian OS" do
|
6
|
+
let :facts do
|
7
|
+
{
|
8
|
+
:osfamily => 'Debian',
|
9
|
+
:operatingsystemrelease => '6',
|
10
|
+
:concat_basedir => '/dne',
|
11
|
+
}
|
12
|
+
end
|
13
|
+
it { should contain_class("apache::params") }
|
14
|
+
it { should contain_apache__mod("auth_kerb") }
|
15
|
+
it { should contain_package("libapache2-mod-auth-kerb") }
|
16
|
+
end
|
17
|
+
context "on a RedHat OS" do
|
18
|
+
let :facts do
|
19
|
+
{
|
20
|
+
:osfamily => 'RedHat',
|
21
|
+
:operatingsystemrelease => '6',
|
22
|
+
:concat_basedir => '/dne',
|
23
|
+
}
|
24
|
+
end
|
25
|
+
it { should contain_class("apache::params") }
|
26
|
+
it { should contain_apache__mod("auth_kerb") }
|
27
|
+
it { should contain_package("mod_auth_kerb") }
|
28
|
+
end
|
29
|
+
context "on a FreeBSD OS" do
|
30
|
+
let :facts do
|
31
|
+
{
|
32
|
+
:osfamily => 'FreeBSD',
|
33
|
+
:operatingsystemrelease => '9',
|
34
|
+
:concat_basedir => '/dne',
|
35
|
+
}
|
36
|
+
end
|
37
|
+
it { should contain_class("apache::params") }
|
38
|
+
it { should contain_apache__mod("auth_kerb") }
|
39
|
+
it { should contain_package("www/mod_auth_kerb2") }
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
describe 'apache::mod::authnz_ldap', :type => :class do
|
2
|
+
let :pre_condition do
|
3
|
+
'include apache'
|
4
|
+
end
|
5
|
+
|
6
|
+
context "on a Debian OS" do
|
7
|
+
let :facts do
|
8
|
+
{
|
9
|
+
:osfamily => 'Debian',
|
10
|
+
:operatingsystemrelease => '6',
|
11
|
+
:concat_basedir => '/dne',
|
12
|
+
}
|
13
|
+
end
|
14
|
+
it { should contain_class("apache::params") }
|
15
|
+
it { should contain_class("apache::mod::ldap") }
|
16
|
+
it { should contain_apache__mod('authnz_ldap') }
|
17
|
+
|
18
|
+
context 'default verifyServerCert' do
|
19
|
+
it { should contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert On$/) }
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'verifyServerCert = false' do
|
23
|
+
let(:params) { { :verifyServerCert => false } }
|
24
|
+
it { should contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert Off$/) }
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'verifyServerCert = wrong' do
|
28
|
+
let(:params) { { :verifyServerCert => 'wrong' } }
|
29
|
+
it 'should raise an error' do
|
30
|
+
expect { should raise_error Puppet::Error }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end #Debian
|
34
|
+
|
35
|
+
context "on a RedHat OS" do
|
36
|
+
let :facts do
|
37
|
+
{
|
38
|
+
:osfamily => 'RedHat',
|
39
|
+
:operatingsystemrelease => '6',
|
40
|
+
:concat_basedir => '/dne',
|
41
|
+
}
|
42
|
+
end
|
43
|
+
it { should contain_class("apache::params") }
|
44
|
+
it { should contain_class("apache::mod::ldap") }
|
45
|
+
it { should contain_apache__mod('authnz_ldap') }
|
46
|
+
|
47
|
+
context 'default verifyServerCert' do
|
48
|
+
it { should contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert On$/) }
|
49
|
+
end
|
50
|
+
|
51
|
+
context 'verifyServerCert = false' do
|
52
|
+
let(:params) { { :verifyServerCert => false } }
|
53
|
+
it { should contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert Off$/) }
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'verifyServerCert = wrong' do
|
57
|
+
let(:params) { { :verifyServerCert => 'wrong' } }
|
58
|
+
it 'should raise an error' do
|
59
|
+
expect { should raise_error Puppet::Error }
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end # Redhat
|
63
|
+
|
64
|
+
end
|
65
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
describe 'apache::mod::dav_svn', :type => :class do
|
2
|
+
let :pre_condition do
|
3
|
+
'include apache'
|
4
|
+
end
|
5
|
+
context "on a Debian OS" do
|
6
|
+
let :facts do
|
7
|
+
{
|
8
|
+
:osfamily => 'Debian',
|
9
|
+
:operatingsystemrelease => '6',
|
10
|
+
:concat_basedir => '/dne',
|
11
|
+
}
|
12
|
+
end
|
13
|
+
it { should contain_class("apache::params") }
|
14
|
+
it { should contain_apache__mod('dav_svn') }
|
15
|
+
it { should contain_package("libapache2-svn") }
|
16
|
+
end
|
17
|
+
context "on a RedHat OS" do
|
18
|
+
let :facts do
|
19
|
+
{
|
20
|
+
:osfamily => 'RedHat',
|
21
|
+
:operatingsystemrelease => '6',
|
22
|
+
:concat_basedir => '/dne',
|
23
|
+
}
|
24
|
+
end
|
25
|
+
it { should contain_class("apache::params") }
|
26
|
+
it { should contain_apache__mod('dav_svn') }
|
27
|
+
it { should contain_package("mod_dav_svn") }
|
28
|
+
end
|
29
|
+
context "on a FreeBSD OS" do
|
30
|
+
let :facts do
|
31
|
+
{
|
32
|
+
:osfamily => 'FreeBSD',
|
33
|
+
:operatingsystemrelease => '9',
|
34
|
+
:concat_basedir => '/dne',
|
35
|
+
}
|
36
|
+
end
|
37
|
+
it { should contain_class("apache::params") }
|
38
|
+
it { should contain_apache__mod('dav_svn') }
|
39
|
+
it { should contain_package("devel/subversion") }
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe 'apache::mod::dev', :type => :class do
|
3
|
+
[
|
4
|
+
['RedHat', '6'],
|
5
|
+
['Debian', '6'],
|
6
|
+
['FreeBSD', '9'],
|
7
|
+
].each do |osfamily, operatingsystemrelease|
|
8
|
+
if osfamily == 'FreeBSD'
|
9
|
+
let :pre_condition do
|
10
|
+
'include apache::package'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
context "on a #{osfamily} OS" do
|
14
|
+
let :facts do
|
15
|
+
{
|
16
|
+
:osfamily => osfamily,
|
17
|
+
:operatingsystemrelease => operatingsystemrelease,
|
18
|
+
}
|
19
|
+
end
|
20
|
+
it { should contain_class('apache::dev') }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|