Skip to content

Commit dddac75

Browse files
Merge pull request #446 from treydock/instance-service_name
Add service_name parameter to tomcat::instance
2 parents 9b89054 + 5a614b9 commit dddac75

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

manifests/instance.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
# ```
4444
# @param copy_from_home_mode
4545
# Specifies the file mode when copying the initial config files from `catalina_home` to `catalina_base`. Valid options: a string containing a standard Linux mode.
46+
# @param service_name
47+
# Name of the service when managing the service
4648
# @param install_from_source
4749
# Specifies whether or not the instance should be installed from source.
4850
# @param source_url
@@ -75,6 +77,7 @@
7577
$manage_copy_from_home = true,
7678
$copy_from_home_list = undef,
7779
$copy_from_home_mode = '0660',
80+
$service_name = undef,
7881

7982
#used for single installs. Deprecated.
8083
$install_from_source = undef,
@@ -203,6 +206,7 @@
203206
}
204207
if $_manage_service {
205208
tomcat::service { $name:
209+
service_name => $service_name,
206210
catalina_home => $_catalina_home,
207211
catalina_base => $_catalina_base,
208212
java_home => $java_home,

spec/defines/instance_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,4 +439,20 @@
439439
it { is_expected.not_to contain_file('/opt/apache-tomcat/foo/webapps') }
440440
it { is_expected.not_to contain_file('/opt/apache-tomcat/foo/work') }
441441
end
442+
context 'manage service init with service_name' do
443+
let :facts do
444+
default_facts
445+
end
446+
let :params do
447+
{
448+
source_url: 'http://mirror.nexcess.net/apache/tomcat/tomcat-8/v8.0.8/bin/apache-tomcat-8.0.8.tar.gz',
449+
manage_service: true,
450+
use_jsvc: false,
451+
use_init: true,
452+
service_name: 'tomcat-default',
453+
}
454+
end
455+
456+
it { is_expected.to contain_service('tomcat-default') }
457+
end
442458
end

0 commit comments

Comments
 (0)