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,88 @@
|
|
1
|
+
describe 'apache::mod::dir', :type => :class do
|
2
|
+
let :pre_condition do
|
3
|
+
'class { "apache":
|
4
|
+
default_mods => false,
|
5
|
+
}'
|
6
|
+
end
|
7
|
+
context "on a Debian OS" do
|
8
|
+
let :facts do
|
9
|
+
{
|
10
|
+
:osfamily => 'Debian',
|
11
|
+
:operatingsystemrelease => '6',
|
12
|
+
:concat_basedir => '/dne',
|
13
|
+
}
|
14
|
+
end
|
15
|
+
context "passing no parameters" do
|
16
|
+
it { should contain_class("apache::params") }
|
17
|
+
it { should contain_apache__mod('dir') }
|
18
|
+
it { should contain_file('dir.conf').with_content(/^DirectoryIndex /) }
|
19
|
+
it { should contain_file('dir.conf').with_content(/ index\.html /) }
|
20
|
+
it { should contain_file('dir.conf').with_content(/ index\.html\.var /) }
|
21
|
+
it { should contain_file('dir.conf').with_content(/ index\.cgi /) }
|
22
|
+
it { should contain_file('dir.conf').with_content(/ index\.pl /) }
|
23
|
+
it { should contain_file('dir.conf').with_content(/ index\.php /) }
|
24
|
+
it { should contain_file('dir.conf').with_content(/ index\.xhtml$/) }
|
25
|
+
end
|
26
|
+
context "passing indexes => ['example.txt','fearsome.aspx']" do
|
27
|
+
let :params do
|
28
|
+
{:indexes => ['example.txt','fearsome.aspx']}
|
29
|
+
end
|
30
|
+
it { should contain_file('dir.conf').with_content(/ example\.txt /) }
|
31
|
+
it { should contain_file('dir.conf').with_content(/ fearsome\.aspx$/) }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
context "on a RedHat OS" do
|
35
|
+
let :facts do
|
36
|
+
{
|
37
|
+
:osfamily => 'RedHat',
|
38
|
+
:operatingsystemrelease => '6',
|
39
|
+
:concat_basedir => '/dne',
|
40
|
+
}
|
41
|
+
end
|
42
|
+
context "passing no parameters" do
|
43
|
+
it { should contain_class("apache::params") }
|
44
|
+
it { should contain_apache__mod('dir') }
|
45
|
+
it { should contain_file('dir.conf').with_content(/^DirectoryIndex /) }
|
46
|
+
it { should contain_file('dir.conf').with_content(/ index\.html /) }
|
47
|
+
it { should contain_file('dir.conf').with_content(/ index\.html\.var /) }
|
48
|
+
it { should contain_file('dir.conf').with_content(/ index\.cgi /) }
|
49
|
+
it { should contain_file('dir.conf').with_content(/ index\.pl /) }
|
50
|
+
it { should contain_file('dir.conf').with_content(/ index\.php /) }
|
51
|
+
it { should contain_file('dir.conf').with_content(/ index\.xhtml$/) }
|
52
|
+
end
|
53
|
+
context "passing indexes => ['example.txt','fearsome.aspx']" do
|
54
|
+
let :params do
|
55
|
+
{:indexes => ['example.txt','fearsome.aspx']}
|
56
|
+
end
|
57
|
+
it { should contain_file('dir.conf').with_content(/ example\.txt /) }
|
58
|
+
it { should contain_file('dir.conf').with_content(/ fearsome\.aspx$/) }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
context "on a FreeBSD OS" do
|
62
|
+
let :facts do
|
63
|
+
{
|
64
|
+
:osfamily => 'FreeBSD',
|
65
|
+
:operatingsystemrelease => '9',
|
66
|
+
:concat_basedir => '/dne',
|
67
|
+
}
|
68
|
+
end
|
69
|
+
context "passing no parameters" do
|
70
|
+
it { should contain_class("apache::params") }
|
71
|
+
it { should contain_apache__mod('dir') }
|
72
|
+
it { should contain_file('dir.conf').with_content(/^DirectoryIndex /) }
|
73
|
+
it { should contain_file('dir.conf').with_content(/ index\.html /) }
|
74
|
+
it { should contain_file('dir.conf').with_content(/ index\.html\.var /) }
|
75
|
+
it { should contain_file('dir.conf').with_content(/ index\.cgi /) }
|
76
|
+
it { should contain_file('dir.conf').with_content(/ index\.pl /) }
|
77
|
+
it { should contain_file('dir.conf').with_content(/ index\.php /) }
|
78
|
+
it { should contain_file('dir.conf').with_content(/ index\.xhtml$/) }
|
79
|
+
end
|
80
|
+
context "passing indexes => ['example.txt','fearsome.aspx']" do
|
81
|
+
let :params do
|
82
|
+
{:indexes => ['example.txt','fearsome.aspx']}
|
83
|
+
end
|
84
|
+
it { should contain_file('dir.conf').with_content(/ example\.txt /) }
|
85
|
+
it { should contain_file('dir.conf').with_content(/ fearsome\.aspx$/) }
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
describe 'apache::mod::event', :type => :class do
|
2
|
+
let :pre_condition do
|
3
|
+
'class { "apache": mpm_module => false, }'
|
4
|
+
end
|
5
|
+
context "on a FreeBSD OS" do
|
6
|
+
let :facts do
|
7
|
+
{
|
8
|
+
:osfamily => 'FreeBSD',
|
9
|
+
:operatingsystemrelease => '9',
|
10
|
+
:concat_basedir => '/dne',
|
11
|
+
}
|
12
|
+
end
|
13
|
+
it { should contain_class("apache::params") }
|
14
|
+
it { should_not contain_apache__mod('event') }
|
15
|
+
it { should contain_file("/usr/local/etc/apache22/Modules/event.conf").with_ensure('file') }
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
describe 'apache::mod::fastcgi', :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('fastcgi') }
|
15
|
+
it { should contain_package("libapache2-mod-fastcgi") }
|
16
|
+
it { should contain_file('fastcgi.conf') }
|
17
|
+
end
|
18
|
+
|
19
|
+
context "on a RedHat OS" do
|
20
|
+
let :facts do
|
21
|
+
{
|
22
|
+
:osfamily => 'RedHat',
|
23
|
+
:operatingsystemrelease => '6',
|
24
|
+
:concat_basedir => '/dne',
|
25
|
+
}
|
26
|
+
end
|
27
|
+
it { should contain_class("apache::params") }
|
28
|
+
it { should contain_apache__mod('fastcgi') }
|
29
|
+
it { should contain_package("mod_fastcgi") }
|
30
|
+
it { should_not contain_file('fastcgi.conf') }
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
describe 'apache::mod::fcgid', :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('fcgid') }
|
15
|
+
it { should contain_package("libapache2-mod-fcgid") }
|
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('fcgid') }
|
27
|
+
it { should contain_package("mod_fcgid") }
|
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('fcgid') }
|
39
|
+
it { should contain_package("www/mod_fcgid") }
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
# This function is called inside the OS specific contexts
|
2
|
+
def general_info_specs
|
3
|
+
it { should contain_apache__mod("info") }
|
4
|
+
|
5
|
+
it do
|
6
|
+
should contain_file("info.conf").with_content(
|
7
|
+
"<Location /server-info>\n"\
|
8
|
+
" SetHandler server-info\n"\
|
9
|
+
" Order deny,allow\n"\
|
10
|
+
" Deny from all\n"\
|
11
|
+
" Allow from 127.0.0.1 ::1\n"\
|
12
|
+
"</Location>\n"
|
13
|
+
)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe 'apache::mod::info', :type => :class do
|
18
|
+
let :pre_condition do
|
19
|
+
'include apache'
|
20
|
+
end
|
21
|
+
|
22
|
+
context "On a Debian OS with default params" do
|
23
|
+
let :facts do
|
24
|
+
{
|
25
|
+
:osfamily => 'Debian',
|
26
|
+
:operatingsystemrelease => '6',
|
27
|
+
:concat_basedir => '/dne',
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Load the more generic tests for this context
|
32
|
+
general_info_specs()
|
33
|
+
|
34
|
+
it { should contain_file("info.conf").with({
|
35
|
+
:ensure => 'file',
|
36
|
+
:path => '/etc/apache2/mods-available/info.conf',
|
37
|
+
} ) }
|
38
|
+
it { should contain_file("info.conf symlink").with({
|
39
|
+
:ensure => 'link',
|
40
|
+
:path => '/etc/apache2/mods-enabled/info.conf',
|
41
|
+
} ) }
|
42
|
+
end
|
43
|
+
|
44
|
+
context "on a RedHat OS with default params" do
|
45
|
+
let :facts do
|
46
|
+
{
|
47
|
+
:osfamily => 'RedHat',
|
48
|
+
:operatingsystemrelease => '6',
|
49
|
+
:concat_basedir => '/dne',
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# Load the more generic tests for this context
|
54
|
+
general_info_specs()
|
55
|
+
|
56
|
+
it { should contain_file("info.conf").with_path("/etc/httpd/conf.d/info.conf") }
|
57
|
+
end
|
58
|
+
|
59
|
+
context "On a FreeBSD OS with default params" do
|
60
|
+
let :facts do
|
61
|
+
{
|
62
|
+
:osfamily => 'FreeBSD',
|
63
|
+
:operatingsystemrelease => '9',
|
64
|
+
:concat_basedir => '/dne',
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
# Load the more generic tests for this context
|
69
|
+
general_info_specs()
|
70
|
+
|
71
|
+
it { should contain_file("info.conf").with({
|
72
|
+
:ensure => 'file',
|
73
|
+
:path => '/usr/local/etc/apache22/Modules/info.conf',
|
74
|
+
} ) }
|
75
|
+
end
|
76
|
+
|
77
|
+
context "with $allow_from => ['10.10.10.10','11.11.11.11']" do
|
78
|
+
let :facts do
|
79
|
+
{
|
80
|
+
:osfamily => 'Debian',
|
81
|
+
:operatingsystemrelease => '6',
|
82
|
+
:concat_basedir => '/dne',
|
83
|
+
}
|
84
|
+
end
|
85
|
+
let :params do
|
86
|
+
{ :allow_from => ['10.10.10.10','11.11.11.11'] }
|
87
|
+
end
|
88
|
+
it do
|
89
|
+
should contain_file("info.conf").with_content(
|
90
|
+
"<Location /server-info>\n"\
|
91
|
+
" SetHandler server-info\n"\
|
92
|
+
" Order deny,allow\n"\
|
93
|
+
" Deny from all\n"\
|
94
|
+
" Allow from 10.10.10.10 11.11.11.11\n"\
|
95
|
+
"</Location>\n"
|
96
|
+
)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
describe 'apache::mod::itk', :type => :class do
|
2
|
+
let :pre_condition do
|
3
|
+
'class { "apache": mpm_module => false, }'
|
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_not contain_apache__mod('itk') }
|
15
|
+
it { should contain_file("/etc/apache2/mods-available/itk.conf").with_ensure('file') }
|
16
|
+
it { should contain_file("/etc/apache2/mods-enabled/itk.conf").with_ensure('link') }
|
17
|
+
it { should contain_package("apache2-mpm-itk") }
|
18
|
+
end
|
19
|
+
context "on a FreeBSD OS" do
|
20
|
+
let :facts do
|
21
|
+
{
|
22
|
+
:osfamily => 'FreeBSD',
|
23
|
+
:operatingsystemrelease => '9',
|
24
|
+
:concat_basedir => '/dne',
|
25
|
+
}
|
26
|
+
end
|
27
|
+
it { should contain_class("apache::params") }
|
28
|
+
it { should_not contain_apache__mod('itk') }
|
29
|
+
it { should contain_file("/usr/local/etc/apache22/Modules/itk.conf").with_ensure('file') }
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# This function is called inside the OS specific contexts
|
2
|
+
def general_mime_magic_specs
|
3
|
+
it { should contain_apache__mod("mime_magic") }
|
4
|
+
end
|
5
|
+
|
6
|
+
describe 'apache::mod::mime_magic', :type => :class do
|
7
|
+
let :pre_condition do
|
8
|
+
'include apache'
|
9
|
+
end
|
10
|
+
|
11
|
+
context "On a Debian OS with default params" do
|
12
|
+
let :facts do
|
13
|
+
{
|
14
|
+
:osfamily => 'Debian',
|
15
|
+
:operatingsystemrelease => '6',
|
16
|
+
:concat_basedir => '/dne',
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
general_mime_magic_specs()
|
21
|
+
|
22
|
+
it do
|
23
|
+
should contain_file("mime_magic.conf").with_content(
|
24
|
+
"MIMEMagicFile /etc/apache2/magic\n"
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
it { should contain_file("mime_magic.conf").with({
|
29
|
+
:ensure => 'file',
|
30
|
+
:path => '/etc/apache2/mods-available/mime_magic.conf',
|
31
|
+
} ) }
|
32
|
+
it { should contain_file("mime_magic.conf symlink").with({
|
33
|
+
:ensure => 'link',
|
34
|
+
:path => '/etc/apache2/mods-enabled/mime_magic.conf',
|
35
|
+
} ) }
|
36
|
+
|
37
|
+
context "with magic_file => /tmp/Debian_magic" do
|
38
|
+
let :params do
|
39
|
+
{ :magic_file => "/tmp/Debian_magic" }
|
40
|
+
end
|
41
|
+
|
42
|
+
it do
|
43
|
+
should contain_file("mime_magic.conf").with_content(
|
44
|
+
"MIMEMagicFile /tmp/Debian_magic\n"
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
context "on a RedHat OS with default params" do
|
52
|
+
let :facts do
|
53
|
+
{
|
54
|
+
:osfamily => 'RedHat',
|
55
|
+
:operatingsystemrelease => '6',
|
56
|
+
:concat_basedir => '/dne',
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
general_mime_magic_specs()
|
61
|
+
|
62
|
+
it do
|
63
|
+
should contain_file("mime_magic.conf").with_content(
|
64
|
+
"MIMEMagicFile /etc/httpd/conf/magic\n"
|
65
|
+
)
|
66
|
+
end
|
67
|
+
|
68
|
+
it { should contain_file("mime_magic.conf").with_path("/etc/httpd/conf.d/mime_magic.conf") }
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
context "with magic_file => /tmp/magic" do
|
73
|
+
let :facts do
|
74
|
+
{
|
75
|
+
:osfamily => 'Debian',
|
76
|
+
:operatingsystemrelease => '6',
|
77
|
+
:concat_basedir => '/dne',
|
78
|
+
}
|
79
|
+
end
|
80
|
+
|
81
|
+
let :params do
|
82
|
+
{ :magic_file => "/tmp/magic" }
|
83
|
+
end
|
84
|
+
|
85
|
+
it do
|
86
|
+
should contain_file("mime_magic.conf").with_content(
|
87
|
+
"MIMEMagicFile /tmp/magic\n"
|
88
|
+
)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
|
93
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
describe 'apache::mod::passenger', :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('passenger') }
|
15
|
+
it { should contain_package("libapache2-mod-passenger") }
|
16
|
+
it { should contain_file('passenger.conf').with({
|
17
|
+
'path' => '/etc/apache2/mods-available/passenger.conf',
|
18
|
+
}) }
|
19
|
+
it { should contain_file('passenger.conf').with_content(/^ PassengerRoot \/usr$/) }
|
20
|
+
it { should contain_file('passenger.conf').with_content(/^ PassengerRuby \/usr\/bin\/ruby$/) }
|
21
|
+
describe "with passenger_high_performance => true" do
|
22
|
+
let :params do
|
23
|
+
{ :passenger_high_performance => 'true' }
|
24
|
+
end
|
25
|
+
it { should contain_file('passenger.conf').with_content(/^ PassengerHighPerformance true$/) }
|
26
|
+
end
|
27
|
+
describe "with passenger_pool_idle_time => 1200" do
|
28
|
+
let :params do
|
29
|
+
{ :passenger_pool_idle_time => 1200 }
|
30
|
+
end
|
31
|
+
it { should contain_file('passenger.conf').with_content(/^ PassengerPoolIdleTime 1200$/) }
|
32
|
+
end
|
33
|
+
describe "with passenger_max_requests => 20" do
|
34
|
+
let :params do
|
35
|
+
{ :passenger_max_requests => 20 }
|
36
|
+
end
|
37
|
+
it { should contain_file('passenger.conf').with_content(/^ PassengerMaxRequests 20$/) }
|
38
|
+
end
|
39
|
+
describe "with passenger_stat_throttle_rate => 10" do
|
40
|
+
let :params do
|
41
|
+
{ :passenger_stat_throttle_rate => 10 }
|
42
|
+
end
|
43
|
+
it { should contain_file('passenger.conf').with_content(/^ PassengerStatThrottleRate 10$/) }
|
44
|
+
end
|
45
|
+
describe "with passenger_max_pool_size => 16" do
|
46
|
+
let :params do
|
47
|
+
{ :passenger_max_pool_size => 16 }
|
48
|
+
end
|
49
|
+
it { should contain_file('passenger.conf').with_content(/^ PassengerMaxPoolSize 16$/) }
|
50
|
+
end
|
51
|
+
describe "with rack_autodetect => true" do
|
52
|
+
let :params do
|
53
|
+
{ :rack_autodetect => true }
|
54
|
+
end
|
55
|
+
it { should contain_file('passenger.conf').with_content(/^ RackAutoDetect true$/) }
|
56
|
+
end
|
57
|
+
describe "with rails_autodetect => true" do
|
58
|
+
let :params do
|
59
|
+
{ :rails_autodetect => true }
|
60
|
+
end
|
61
|
+
it { should contain_file('passenger.conf').with_content(/^ RailsAutoDetect true$/) }
|
62
|
+
end
|
63
|
+
describe "with passenger_root => '/usr/lib/example'" do
|
64
|
+
let :params do
|
65
|
+
{ :passenger_root => '/usr/lib/example' }
|
66
|
+
end
|
67
|
+
it { should contain_file('passenger.conf').with_content(/^ PassengerRoot \/usr\/lib\/example$/) }
|
68
|
+
end
|
69
|
+
describe "with passenger_ruby => /user/lib/example/ruby" do
|
70
|
+
let :params do
|
71
|
+
{ :passenger_ruby => '/user/lib/example/ruby' }
|
72
|
+
end
|
73
|
+
it { should contain_file('passenger.conf').with_content(/^ PassengerRuby \/user\/lib\/example\/ruby$/) }
|
74
|
+
end
|
75
|
+
describe "with passenger_use_global_queue => true" do
|
76
|
+
let :params do
|
77
|
+
{ :passenger_use_global_queue => 'true' }
|
78
|
+
end
|
79
|
+
it { should contain_file('passenger.conf').with_content(/^ PassengerUseGlobalQueue true$/) }
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
context "on a RedHat OS" do
|
84
|
+
let :facts do
|
85
|
+
{
|
86
|
+
:osfamily => 'RedHat',
|
87
|
+
:operatingsystemrelease => '6',
|
88
|
+
:concat_basedir => '/dne',
|
89
|
+
}
|
90
|
+
end
|
91
|
+
it { should contain_class("apache::params") }
|
92
|
+
it { should contain_apache__mod('passenger') }
|
93
|
+
it { should contain_package("mod_passenger") }
|
94
|
+
it { should contain_file('passenger.conf').with({
|
95
|
+
'path' => '/etc/httpd/conf.d/passenger.conf',
|
96
|
+
}) }
|
97
|
+
it { should contain_file('passenger.conf').with_content(/^ PassengerRoot \/usr\/share\/rubygems\/gems\/passenger-3.0.17$/) }
|
98
|
+
it { should contain_file('passenger.conf').with_content(/^ PassengerRuby \/usr\/bin\/ruby$/) }
|
99
|
+
end
|
100
|
+
context "on a FreeBSD OS" do
|
101
|
+
let :facts do
|
102
|
+
{
|
103
|
+
:osfamily => 'FreeBSD',
|
104
|
+
:operatingsystemrelease => '9',
|
105
|
+
:concat_basedir => '/dne',
|
106
|
+
}
|
107
|
+
end
|
108
|
+
it { should contain_class("apache::params") }
|
109
|
+
it { should contain_apache__mod('passenger') }
|
110
|
+
it { should contain_package("www/rubygem-passenger") }
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
describe 'apache::mod::perl', :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('perl') }
|
15
|
+
it { should contain_package("libapache2-mod-perl2") }
|
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('perl') }
|
27
|
+
it { should contain_package("mod_perl") }
|
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('perl') }
|
39
|
+
it { should contain_package("www/mod_perl2") }
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
describe 'apache::mod::peruser', :type => :class do
|
2
|
+
let :pre_condition do
|
3
|
+
'class { "apache": mpm_module => false, }'
|
4
|
+
end
|
5
|
+
context "on a FreeBSD OS" do
|
6
|
+
let :facts do
|
7
|
+
{
|
8
|
+
:osfamily => 'FreeBSD',
|
9
|
+
:operatingsystemrelease => '9',
|
10
|
+
:concat_basedir => '/dne',
|
11
|
+
}
|
12
|
+
end
|
13
|
+
it { should contain_class("apache::params") }
|
14
|
+
it { should_not contain_apache__mod('peruser') }
|
15
|
+
it { should contain_file("/usr/local/etc/apache22/Modules/peruser.conf").with_ensure('file') }
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
describe 'apache::mod::php', :type => :class do
|
2
|
+
describe "on a Debian OS" do
|
3
|
+
let :facts do
|
4
|
+
{
|
5
|
+
:osfamily => 'Debian',
|
6
|
+
:operatingsystemrelease => '6',
|
7
|
+
:concat_basedir => '/dne',
|
8
|
+
}
|
9
|
+
end
|
10
|
+
context "with mpm_module => prefork" do
|
11
|
+
let :pre_condition do
|
12
|
+
'class { "apache": mpm_module => prefork, }'
|
13
|
+
end
|
14
|
+
it { should contain_class("apache::params") }
|
15
|
+
it { should contain_apache__mod('php5') }
|
16
|
+
it { should contain_package("libapache2-mod-php5") }
|
17
|
+
it { should contain_file("php5.load").with(
|
18
|
+
:content => "LoadModule php5_module /usr/lib/apache2/modules/libphp5.so\n"
|
19
|
+
) }
|
20
|
+
end
|
21
|
+
context 'with mpm_module => worker' do
|
22
|
+
let :pre_condition do
|
23
|
+
'class { "apache": mpm_module => worker, }'
|
24
|
+
end
|
25
|
+
it 'should raise an error' do
|
26
|
+
expect { subject }.to raise_error Puppet::Error, /mpm_module => 'prefork'/
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
describe "on a RedHat OS" do
|
31
|
+
let :facts do
|
32
|
+
{
|
33
|
+
:osfamily => 'RedHat',
|
34
|
+
:operatingsystemrelease => '6',
|
35
|
+
:concat_basedir => '/dne',
|
36
|
+
}
|
37
|
+
end
|
38
|
+
context "with default params" do
|
39
|
+
let :pre_condition do
|
40
|
+
'class { "apache": }'
|
41
|
+
end
|
42
|
+
it { should contain_class("apache::params") }
|
43
|
+
it { should contain_apache__mod('php5') }
|
44
|
+
it { should contain_package("php") }
|
45
|
+
it { should contain_file("php5.load").with(
|
46
|
+
:content => "LoadModule php5_module modules/libphp5.so\n"
|
47
|
+
) }
|
48
|
+
end
|
49
|
+
context "with specific version" do
|
50
|
+
let :pre_condition do
|
51
|
+
'class { "apache": }'
|
52
|
+
end
|
53
|
+
let :params do
|
54
|
+
{ :package_ensure => '5.3.13'}
|
55
|
+
end
|
56
|
+
it { should contain_package("php").with(
|
57
|
+
:ensure => '5.3.13'
|
58
|
+
) }
|
59
|
+
end
|
60
|
+
context "with mpm_module => prefork" do
|
61
|
+
let :pre_condition do
|
62
|
+
'class { "apache": mpm_module => prefork, }'
|
63
|
+
end
|
64
|
+
it { should contain_class("apache::params") }
|
65
|
+
it { should contain_apache__mod('php5') }
|
66
|
+
it { should contain_package("php") }
|
67
|
+
it { should contain_file("php5.load").with(
|
68
|
+
:content => "LoadModule php5_module modules/libphp5.so\n"
|
69
|
+
) }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
describe "on a FreeBSD OS" do
|
73
|
+
let :facts do
|
74
|
+
{
|
75
|
+
:osfamily => 'FreeBSD',
|
76
|
+
:operatingsystemrelease => '9',
|
77
|
+
:concat_basedir => '/dne',
|
78
|
+
}
|
79
|
+
end
|
80
|
+
context "with mpm_module => prefork" do
|
81
|
+
let :pre_condition do
|
82
|
+
'class { "apache": mpm_module => prefork, }'
|
83
|
+
end
|
84
|
+
it { should contain_class('apache::params') }
|
85
|
+
it { should contain_apache__mod('php5') }
|
86
|
+
it { should contain_package("lang/php5") }
|
87
|
+
it { should contain_file('php5.load') }
|
88
|
+
end
|
89
|
+
# FIXME: not sure about the following context
|
90
|
+
context 'with mpm_module => worker' do
|
91
|
+
let :pre_condition do
|
92
|
+
'class { "apache": mpm_module => worker, }'
|
93
|
+
end
|
94
|
+
it 'should raise an error' do
|
95
|
+
expect { subject.should contain_apache__mod('php5') }.to raise_error Puppet::Error, /mpm_module => 'prefork'/
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|