Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.

Commit f04af7a

Browse files
committed
Fix apache proxy + test
1 parent 7dc6ad7 commit f04af7a

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

.fixtures.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ fixtures:
55
"firewall": "git://github.com/example42/puppet-firewall.git"
66
"iptables": "git://github.com/example42/puppet-iptables.git"
77
"concat": "git://github.com/example42/puppet-concat.git"
8+
"apache": "git://github.com/example42/puppet-apache.git"
89
"stdlib": "https://github.com/puppetlabs/puppetlabs-stdlib"
910
symlinks:
1011
"tomcat": "#{source_dir}"

manifests/instance.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,9 @@
427427
fail('You must specify the parameter apache_vhost_server_name on your tomcat::install when apache_vhost_create == true')
428428
}
429429

430+
$proxy_alias = $array_instance_apache_vhost_proxy_alias
430431
apache::vhost { $instance_name:
431-
server_name => $apache_vhost_server_name ,
432-
proxy_alias => $array_instance_apache_vhost_proxy_alias,
432+
server_name => $apache_vhost_server_name,
433433
template => $apache_vhost_template,
434434
docroot => $apache_vhost_docroot,
435435
}

spec/defines/tomcat_instance_spec.rb

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
:http_port => 8080,
99
:control_port => 8480,
1010
} }
11+
let (:facts) { {
12+
:operatingsystem => 'CentOS',
13+
:osfamily => 'RedHat',
14+
} }
1115

1216
describe 'Test CentOS usage' do
1317
let (:facts) { {
@@ -36,6 +40,35 @@
3640
it { should contain_file('instance_tomcat_defaults_tomcat_instance').with_path('/etc/default/tomcat6-tomcat_instance') }
3741
end
3842

43+
describe "Test apache vhost creation" do
44+
let(:params) { {
45+
:http_port => 8080,
46+
:control_port => 8480,
47+
:apache_vhost_create => true,
48+
:apache_vhost_server_name => 'tomcat.example42.com',
49+
} }
50+
51+
describe "Simple" do
52+
it { should contain_file('/etc/httpd/conf.d/50-tomcat_instance.conf').with_content(/ProxyPass \/tomcat_instance http:\/\/localhost:8080\/tomcat_instance/) }
53+
it { should contain_file('/etc/httpd/conf.d/50-tomcat_instance.conf').with_content(/ProxyPassReverse \/tomcat_instance http:\/\/localhost:8080\/tomcat_instance/) }
54+
end
55+
56+
describe "With manager enabled" do
57+
let(:params) { {
58+
:http_port => 8080,
59+
:control_port => 8480,
60+
:apache_vhost_create => true,
61+
:apache_vhost_server_name => 'tomcat.example42.com',
62+
:manager => true,
63+
} }
64+
it { should contain_apache__vhost('tomcat_instance').with_server_name('tomcat.example42.com') }
65+
it { should contain_file('/etc/httpd/conf.d/50-tomcat_instance.conf').with_content(/ProxyPass \/tomcat_instance http:\/\/localhost:8080\/tomcat_instance/) }
66+
it { should contain_file('/etc/httpd/conf.d/50-tomcat_instance.conf').with_content(/ProxyPassReverse \/tomcat_instance http:\/\/localhost:8080\/tomcat_instance/) }
67+
it { should contain_file('/etc/httpd/conf.d/50-tomcat_instance.conf').with_content(/ProxyPassReverse \/manager http:\/\/localhost:8080\/manager/) }
68+
it { should contain_file('/etc/httpd/conf.d/50-tomcat_instance.conf').with_content(/ProxyPassReverse \/manager http:\/\/localhost:8080\/manager/) }
69+
end
70+
end
71+
3972

4073
end
4174

0 commit comments

Comments
 (0)