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,47 @@
|
|
1
|
+
describe 'apache::mod::prefork', :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('prefork') }
|
15
|
+
it { should contain_file("/etc/apache2/mods-available/prefork.conf").with_ensure('file') }
|
16
|
+
it { should contain_file("/etc/apache2/mods-enabled/prefork.conf").with_ensure('link') }
|
17
|
+
it { should contain_package("apache2-mpm-prefork") }
|
18
|
+
end
|
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_not contain_apache__mod('prefork') }
|
29
|
+
it { should contain_file("/etc/httpd/conf.d/prefork.conf").with_ensure('file') }
|
30
|
+
it { should contain_file_line("/etc/sysconfig/httpd prefork enable").with({
|
31
|
+
'require' => 'Package[httpd]',
|
32
|
+
})
|
33
|
+
}
|
34
|
+
end
|
35
|
+
context "on a FreeBSD OS" do
|
36
|
+
let :facts do
|
37
|
+
{
|
38
|
+
:osfamily => 'FreeBSD',
|
39
|
+
:operatingsystemrelease => '9',
|
40
|
+
:concat_basedir => '/dne',
|
41
|
+
}
|
42
|
+
end
|
43
|
+
it { should contain_class("apache::params") }
|
44
|
+
it { should_not contain_apache__mod('prefork') }
|
45
|
+
it { should contain_file("/usr/local/etc/apache22/Modules/prefork.conf").with_ensure('file') }
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
describe 'apache::mod::proxy_html', :type => :class do
|
2
|
+
let :pre_condition do
|
3
|
+
[
|
4
|
+
'include apache',
|
5
|
+
'include apache::mod::proxy',
|
6
|
+
'include apache::mod::proxy_http',
|
7
|
+
]
|
8
|
+
end
|
9
|
+
context "on a Debian OS" do
|
10
|
+
let :facts do
|
11
|
+
{
|
12
|
+
:osfamily => 'Debian',
|
13
|
+
:operatingsystemrelease => '6',
|
14
|
+
:concat_basedir => '/dne',
|
15
|
+
}
|
16
|
+
end
|
17
|
+
it { should contain_class("apache::params") }
|
18
|
+
it { should contain_apache__mod('proxy_html') }
|
19
|
+
it { should contain_package("libapache2-mod-proxy-html") }
|
20
|
+
end
|
21
|
+
context "on a RedHat OS" do
|
22
|
+
let :facts do
|
23
|
+
{
|
24
|
+
:osfamily => 'RedHat',
|
25
|
+
:operatingsystemrelease => '6',
|
26
|
+
:concat_basedir => '/dne',
|
27
|
+
}
|
28
|
+
end
|
29
|
+
it { should contain_class("apache::params") }
|
30
|
+
it { should contain_apache__mod('proxy_html') }
|
31
|
+
it { should contain_package("mod_proxy_html") }
|
32
|
+
end
|
33
|
+
context "on a FreeBSD OS" do
|
34
|
+
let :facts do
|
35
|
+
{
|
36
|
+
:osfamily => 'FreeBSD',
|
37
|
+
:operatingsystemrelease => '9',
|
38
|
+
:concat_basedir => '/dne',
|
39
|
+
}
|
40
|
+
end
|
41
|
+
it { should contain_class("apache::params") }
|
42
|
+
it { should contain_apache__mod('proxy_html') }
|
43
|
+
it { should contain_package("www/mod_proxy_html") }
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
describe 'apache::mod::python', :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("python") }
|
15
|
+
it { should contain_package("libapache2-mod-python") }
|
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("python") }
|
27
|
+
it { should contain_package("mod_python") }
|
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("python") }
|
39
|
+
it { should contain_package("www/mod_python3") }
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
describe 'apache::mod::rpaf', :type => :class do
|
2
|
+
let :pre_condition do
|
3
|
+
[
|
4
|
+
'include apache',
|
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
|
+
it { should contain_class("apache::params") }
|
16
|
+
it { should contain_apache__mod('rpaf') }
|
17
|
+
it { should contain_package("libapache2-mod-rpaf") }
|
18
|
+
it { should contain_file('rpaf.conf').with({
|
19
|
+
'path' => '/etc/apache2/mods-available/rpaf.conf',
|
20
|
+
}) }
|
21
|
+
it { should contain_file('rpaf.conf').with_content(/^RPAFenable On$/) }
|
22
|
+
|
23
|
+
describe "with sethostname => true" do
|
24
|
+
let :params do
|
25
|
+
{ :sethostname => 'true' }
|
26
|
+
end
|
27
|
+
it { should contain_file('rpaf.conf').with_content(/^RPAFsethostname On$/) }
|
28
|
+
end
|
29
|
+
describe "with proxy_ips => [ 10.42.17.8, 10.42.18.99 ]" do
|
30
|
+
let :params do
|
31
|
+
{ :proxy_ips => [ '10.42.17.8', '10.42.18.99' ] }
|
32
|
+
end
|
33
|
+
it { should contain_file('rpaf.conf').with_content(/^RPAFproxy_ips 10.42.17.8 10.42.18.99$/) }
|
34
|
+
end
|
35
|
+
describe "with header => X-Real-IP" do
|
36
|
+
let :params do
|
37
|
+
{ :header => 'X-Real-IP' }
|
38
|
+
end
|
39
|
+
it { should contain_file('rpaf.conf').with_content(/^RPAFheader X-Real-IP$/) }
|
40
|
+
end
|
41
|
+
end
|
42
|
+
context "on a FreeBSD OS" do
|
43
|
+
let :facts do
|
44
|
+
{
|
45
|
+
:osfamily => 'FreeBSD',
|
46
|
+
:operatingsystemrelease => '9',
|
47
|
+
:concat_basedir => '/dne',
|
48
|
+
}
|
49
|
+
end
|
50
|
+
it { should contain_class("apache::params") }
|
51
|
+
it { should contain_apache__mod('rpaf') }
|
52
|
+
it { should contain_package("www/mod_rpaf2") }
|
53
|
+
it { should contain_file('rpaf.conf').with({
|
54
|
+
'path' => '/usr/local/etc/apache22/Modules/rpaf.conf',
|
55
|
+
}) }
|
56
|
+
it { should contain_file('rpaf.conf').with_content(/^RPAFenable On$/) }
|
57
|
+
|
58
|
+
describe "with sethostname => true" do
|
59
|
+
let :params do
|
60
|
+
{ :sethostname => 'true' }
|
61
|
+
end
|
62
|
+
it { should contain_file('rpaf.conf').with_content(/^RPAFsethostname On$/) }
|
63
|
+
end
|
64
|
+
describe "with proxy_ips => [ 10.42.17.8, 10.42.18.99 ]" do
|
65
|
+
let :params do
|
66
|
+
{ :proxy_ips => [ '10.42.17.8', '10.42.18.99' ] }
|
67
|
+
end
|
68
|
+
it { should contain_file('rpaf.conf').with_content(/^RPAFproxy_ips 10.42.17.8 10.42.18.99$/) }
|
69
|
+
end
|
70
|
+
describe "with header => X-Real-IP" do
|
71
|
+
let :params do
|
72
|
+
{ :header => 'X-Real-IP' }
|
73
|
+
end
|
74
|
+
it { should contain_file('rpaf.conf').with_content(/^RPAFheader X-Real-IP$/) }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
describe 'apache::mod::ssl', :type => :class do
|
2
|
+
let :pre_condition do
|
3
|
+
'include apache'
|
4
|
+
end
|
5
|
+
context 'on an unsupported OS' do
|
6
|
+
let :facts do
|
7
|
+
{
|
8
|
+
:osfamily => 'Magic',
|
9
|
+
:operatingsystemrelease => '0',
|
10
|
+
:concat_basedir => '/dne',
|
11
|
+
}
|
12
|
+
end
|
13
|
+
it { expect { subject }.to raise_error(Puppet::Error, /Unsupported osfamily:/) }
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'on a RedHat OS' do
|
17
|
+
let :facts do
|
18
|
+
{
|
19
|
+
:osfamily => 'RedHat',
|
20
|
+
:operatingsystemrelease => '6',
|
21
|
+
:concat_basedir => '/dne',
|
22
|
+
}
|
23
|
+
end
|
24
|
+
it { should contain_class('apache::params') }
|
25
|
+
it { should contain_apache__mod('ssl') }
|
26
|
+
it { should contain_package('mod_ssl') }
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'on a Debian OS' do
|
30
|
+
let :facts do
|
31
|
+
{
|
32
|
+
:osfamily => 'Debian',
|
33
|
+
:operatingsystemrelease => '6',
|
34
|
+
:concat_basedir => '/dne',
|
35
|
+
}
|
36
|
+
end
|
37
|
+
it { should contain_class('apache::params') }
|
38
|
+
it { should contain_apache__mod('ssl') }
|
39
|
+
it { should_not contain_package('libapache2-mod-ssl') }
|
40
|
+
end
|
41
|
+
|
42
|
+
context 'on a FreeBSD OS' do
|
43
|
+
let :facts do
|
44
|
+
{
|
45
|
+
:osfamily => 'FreeBSD',
|
46
|
+
:operatingsystemrelease => '9',
|
47
|
+
:concat_basedir => '/dne',
|
48
|
+
}
|
49
|
+
end
|
50
|
+
it { should contain_class('apache::params') }
|
51
|
+
it { should contain_apache__mod('ssl') }
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,166 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# Helper function for testing the contents of `status.conf`
|
4
|
+
def status_conf_spec(allow_from, extended_status)
|
5
|
+
it do
|
6
|
+
should contain_file("status.conf").with_content(
|
7
|
+
"<Location /server-status>\n"\
|
8
|
+
" SetHandler server-status\n"\
|
9
|
+
" Order deny,allow\n"\
|
10
|
+
" Deny from all\n"\
|
11
|
+
" Allow from #{Array(allow_from).join(' ')}\n"\
|
12
|
+
"</Location>\n"\
|
13
|
+
"ExtendedStatus #{extended_status}\n"\
|
14
|
+
"\n"\
|
15
|
+
"<IfModule mod_proxy.c>\n"\
|
16
|
+
" # Show Proxy LoadBalancer status in mod_status\n"\
|
17
|
+
" ProxyStatus On\n"\
|
18
|
+
"</IfModule>\n"
|
19
|
+
)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe 'apache::mod::status', :type => :class do
|
24
|
+
let :pre_condition do
|
25
|
+
'include apache'
|
26
|
+
end
|
27
|
+
|
28
|
+
context "on a Debian OS with default params" do
|
29
|
+
let :facts do
|
30
|
+
{
|
31
|
+
:osfamily => 'Debian',
|
32
|
+
:operatingsystemrelease => '6',
|
33
|
+
:concat_basedir => '/dne',
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
it { should contain_apache__mod("status") }
|
38
|
+
|
39
|
+
status_conf_spec(["127.0.0.1", "::1"], "On")
|
40
|
+
|
41
|
+
it { should contain_file("status.conf").with({
|
42
|
+
:ensure => 'file',
|
43
|
+
:path => '/etc/apache2/mods-available/status.conf',
|
44
|
+
} ) }
|
45
|
+
|
46
|
+
it { should contain_file("status.conf symlink").with({
|
47
|
+
:ensure => 'link',
|
48
|
+
:path => '/etc/apache2/mods-enabled/status.conf',
|
49
|
+
} ) }
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
context "on a RedHat OS with default params" do
|
54
|
+
let :facts do
|
55
|
+
{
|
56
|
+
:osfamily => 'RedHat',
|
57
|
+
:operatingsystemrelease => '6',
|
58
|
+
:concat_basedir => '/dne',
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
it { should contain_apache__mod("status") }
|
63
|
+
|
64
|
+
status_conf_spec(["127.0.0.1", "::1"], "On")
|
65
|
+
|
66
|
+
it { should contain_file("status.conf").with_path("/etc/httpd/conf.d/status.conf") }
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
context "with custom parameters $allow_from => ['10.10.10.10','11.11.11.11'], $extended_status => 'Off'" do
|
71
|
+
let :facts do
|
72
|
+
{
|
73
|
+
:osfamily => 'Debian',
|
74
|
+
:operatingsystemrelease => '6',
|
75
|
+
:concat_basedir => '/dne',
|
76
|
+
}
|
77
|
+
end
|
78
|
+
let :params do
|
79
|
+
{
|
80
|
+
:allow_from => ['10.10.10.10','11.11.11.11'],
|
81
|
+
:extended_status => 'Off',
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
status_conf_spec(["10.10.10.10", "11.11.11.11"], "Off")
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
context "with valid parameter type $allow_from => ['10.10.10.10']" do
|
90
|
+
let :facts do
|
91
|
+
{
|
92
|
+
:osfamily => 'Debian',
|
93
|
+
:operatingsystemrelease => '6',
|
94
|
+
:concat_basedir => '/dne',
|
95
|
+
}
|
96
|
+
end
|
97
|
+
let :params do
|
98
|
+
{ :allow_from => ['10.10.10.10'] }
|
99
|
+
end
|
100
|
+
it 'should expect to succeed array validation' do
|
101
|
+
expect {
|
102
|
+
should contain_file("status.conf")
|
103
|
+
}.not_to raise_error()
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
context "with invalid parameter type $allow_from => '10.10.10.10'" do
|
108
|
+
let :facts do
|
109
|
+
{
|
110
|
+
:osfamily => 'Debian',
|
111
|
+
:operatingsystemrelease => '6',
|
112
|
+
:concat_basedir => '/dne',
|
113
|
+
}
|
114
|
+
end
|
115
|
+
let :params do
|
116
|
+
{ :allow_from => '10.10.10.10' }
|
117
|
+
end
|
118
|
+
it 'should expect to fail array validation' do
|
119
|
+
expect {
|
120
|
+
should contain_file("status.conf")
|
121
|
+
}.to raise_error(Puppet::Error)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
# Only On or Off are valid options
|
126
|
+
['On', 'Off'].each do |valid_param|
|
127
|
+
context "with valid value $extended_status => '#{valid_param}'" do
|
128
|
+
let :facts do
|
129
|
+
{
|
130
|
+
:osfamily => 'Debian',
|
131
|
+
:operatingsystemrelease => '6',
|
132
|
+
:concat_basedir => '/dne',
|
133
|
+
}
|
134
|
+
end
|
135
|
+
let :params do
|
136
|
+
{ :extended_status => valid_param }
|
137
|
+
end
|
138
|
+
it 'should expect to succeed regular expression validation' do
|
139
|
+
expect {
|
140
|
+
should contain_file("status.conf")
|
141
|
+
}.not_to raise_error()
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
['Yes', 'No'].each do |invalid_param|
|
147
|
+
context "with invalid value $extended_status => '#{invalid_param}'" do
|
148
|
+
let :facts do
|
149
|
+
{
|
150
|
+
:osfamily => 'Debian',
|
151
|
+
:operatingsystemrelease => '6',
|
152
|
+
:concat_basedir => '/dne',
|
153
|
+
}
|
154
|
+
end
|
155
|
+
let :params do
|
156
|
+
{ :extended_status => invalid_param }
|
157
|
+
end
|
158
|
+
it 'should expect to fail regular expression validation' do
|
159
|
+
expect {
|
160
|
+
should contain_file("status.conf")
|
161
|
+
}.to raise_error(Puppet::Error)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
describe 'apache::mod::suphp', :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_package("libapache2-mod-suphp") }
|
15
|
+
end
|
16
|
+
context "on a RedHat OS" do
|
17
|
+
let :facts do
|
18
|
+
{
|
19
|
+
:osfamily => 'RedHat',
|
20
|
+
:operatingsystemrelease => '6',
|
21
|
+
:concat_basedir => '/dne',
|
22
|
+
}
|
23
|
+
end
|
24
|
+
it { should contain_class("apache::params") }
|
25
|
+
it { should contain_package("mod_suphp") }
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
describe 'apache::mod::worker', :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('worker') }
|
15
|
+
it { should contain_file("/etc/apache2/mods-available/worker.conf").with_ensure('file') }
|
16
|
+
it { should contain_file("/etc/apache2/mods-enabled/worker.conf").with_ensure('link') }
|
17
|
+
it { should contain_package("apache2-mpm-worker") }
|
18
|
+
end
|
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_not contain_apache__mod('worker') }
|
29
|
+
it { should contain_file("/etc/httpd/conf.d/worker.conf").with_ensure('file') }
|
30
|
+
it { should contain_file_line("/etc/sysconfig/httpd worker enable") }
|
31
|
+
end
|
32
|
+
context "on a FreeBSD OS" do
|
33
|
+
let :facts do
|
34
|
+
{
|
35
|
+
:osfamily => 'FreeBSD',
|
36
|
+
:operatingsystemrelease => '9',
|
37
|
+
:concat_basedir => '/dne',
|
38
|
+
}
|
39
|
+
end
|
40
|
+
it { should contain_class("apache::params") }
|
41
|
+
it { should_not contain_apache__mod('worker') }
|
42
|
+
it { should contain_file("/usr/local/etc/apache22/Modules/worker.conf").with_ensure('file') }
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
describe 'apache::mod::wsgi', :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('wsgi') }
|
15
|
+
it { should contain_package("libapache2-mod-wsgi") }
|
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('wsgi') }
|
27
|
+
it { should contain_package("mod_wsgi") }
|
28
|
+
|
29
|
+
describe "with custom WSGISocketPrefix" do
|
30
|
+
let :params do
|
31
|
+
{ :wsgi_socket_prefix => 'run/wsgi' }
|
32
|
+
end
|
33
|
+
it {should contain_file('wsgi.conf').with_content(/^ WSGISocketPrefix run\/wsgi$/)}
|
34
|
+
end
|
35
|
+
describe "with custom WSGIPythonHome" do
|
36
|
+
let :params do
|
37
|
+
{ :wsgi_python_home => '/path/to/virtenv' }
|
38
|
+
end
|
39
|
+
it {should contain_file('wsgi.conf').with_content(/^ WSGIPythonHome \/path\/to\/virtenv$/)}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
context "on a FreeBSD OS" do
|
43
|
+
let :facts do
|
44
|
+
{
|
45
|
+
:osfamily => 'FreeBSD',
|
46
|
+
:operatingsystemrelease => '9',
|
47
|
+
:concat_basedir => '/dne',
|
48
|
+
}
|
49
|
+
end
|
50
|
+
it { should contain_class("apache::params") }
|
51
|
+
it { should contain_apache__mod('wsgi') }
|
52
|
+
it { should contain_package("www/mod_wsgi") }
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'apache::params', :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_apache__params }
|
13
|
+
|
14
|
+
# There are 4 resources in this class currently
|
15
|
+
# there should not be any more resources because it is a params class
|
16
|
+
# The resources are class[apache::params], class[main], class[settings], stage[main]
|
17
|
+
it "Should not contain any resources" do
|
18
|
+
subject.resources.size.should == 4
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'apache::service', :type => :class do
|
4
|
+
let :pre_condition do
|
5
|
+
'include apache::params'
|
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
|
+
it { should contain_service("httpd").with(
|
16
|
+
'name' => 'apache2',
|
17
|
+
'ensure' => 'running',
|
18
|
+
'enable' => 'true'
|
19
|
+
)
|
20
|
+
}
|
21
|
+
|
22
|
+
context "with $service_name => 'foo'" do
|
23
|
+
let (:params) {{ :service_name => 'foo' }}
|
24
|
+
it { should contain_service("httpd").with(
|
25
|
+
'name' => 'foo'
|
26
|
+
)
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
context "with $service_enable => true" do
|
31
|
+
let (:params) {{ :service_enable => true }}
|
32
|
+
it { should contain_service("httpd").with(
|
33
|
+
'name' => 'apache2',
|
34
|
+
'ensure' => 'running',
|
35
|
+
'enable' => 'true'
|
36
|
+
)
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
context "with $service_enable => false" do
|
41
|
+
let (:params) {{ :service_enable => false }}
|
42
|
+
it { should contain_service("httpd").with(
|
43
|
+
'name' => 'apache2',
|
44
|
+
'ensure' => 'running',
|
45
|
+
'enable' => 'false'
|
46
|
+
)
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
context "$service_enable must be a bool" do
|
51
|
+
let (:params) {{ :service_enable => 'not-a-boolean' }}
|
52
|
+
|
53
|
+
it 'should fail' do
|
54
|
+
expect { subject }.to raise_error(Puppet::Error, /is not a boolean/)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
context "with $service_ensure => 'running'" do
|
59
|
+
let (:params) {{ :service_ensure => 'running', }}
|
60
|
+
it { should contain_service("httpd").with(
|
61
|
+
'ensure' => 'running',
|
62
|
+
'enable' => 'true'
|
63
|
+
)
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
context "with $service_ensure => 'stopped'" do
|
68
|
+
let (:params) {{ :service_ensure => 'stopped', }}
|
69
|
+
it { should contain_service("httpd").with(
|
70
|
+
'ensure' => 'stopped',
|
71
|
+
'enable' => 'true'
|
72
|
+
)
|
73
|
+
}
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
|
78
|
+
context "on a RedHat 5 OS" do
|
79
|
+
let :facts do
|
80
|
+
{
|
81
|
+
:osfamily => 'RedHat',
|
82
|
+
:operatingsystemrelease => '5',
|
83
|
+
:concat_basedir => '/dne',
|
84
|
+
}
|
85
|
+
end
|
86
|
+
it { should contain_service("httpd").with(
|
87
|
+
'name' => 'httpd',
|
88
|
+
'ensure' => 'running',
|
89
|
+
'enable' => 'true'
|
90
|
+
)
|
91
|
+
}
|
92
|
+
end
|
93
|
+
|
94
|
+
context "on a FreeBSD 5 OS" do
|
95
|
+
let :facts do
|
96
|
+
{
|
97
|
+
:osfamily => 'FreeBSD',
|
98
|
+
:operatingsystemrelease => '9',
|
99
|
+
:concat_basedir => '/dne',
|
100
|
+
}
|
101
|
+
end
|
102
|
+
it { should contain_service("httpd").with(
|
103
|
+
'name' => 'apache22',
|
104
|
+
'ensure' => 'running',
|
105
|
+
'enable' => 'true'
|
106
|
+
)
|
107
|
+
}
|
108
|
+
end
|
109
|
+
end
|