File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1189,6 +1189,54 @@ def self.clear_cache
11891189 end
11901190 end
11911191
1192+ context 'enable clustering with short fqdn' do
1193+ let ( :params ) do
1194+ super ( ) . merge (
1195+ datacenter : true ,
1196+ shared_homedir : '/mnt/jira_shared_home_dir'
1197+ )
1198+ end
1199+
1200+ let ( :facts ) do
1201+ super ( ) . merge (
1202+ networking : {
1203+ 'fqdn' => 'short-hostname.example.com' ,
1204+ 'hostname' => 'short-hostname'
1205+ }
1206+ )
1207+ end
1208+
1209+ it do
1210+ is_expected . to contain_file ( FILENAME_CLUSTER_PROPS ) .
1211+ with_content ( %r{jira.node.id = short-hostname.example.com} ) .
1212+ with_content ( %r{jira.shared.home = /mnt/jira_shared_home_dir} )
1213+ end
1214+ end
1215+
1216+ context 'enable clustering with long fqdn exceeding 60 characters' do
1217+ let ( :params ) do
1218+ super ( ) . merge (
1219+ datacenter : true ,
1220+ shared_homedir : '/mnt/jira_shared_home_dir'
1221+ )
1222+ end
1223+
1224+ let ( :facts ) do
1225+ super ( ) . merge (
1226+ networking : {
1227+ 'fqdn' => 'this-is-a-very-long-hostname-that-exceeds-sixty-characters.example.com' ,
1228+ 'hostname' => 'long-hostname'
1229+ }
1230+ )
1231+ end
1232+
1233+ it do
1234+ is_expected . to contain_file ( FILENAME_CLUSTER_PROPS ) .
1235+ with_content ( %r{jira.node.id = long-hostname} ) .
1236+ with_content ( %r{jira.shared.home = /mnt/jira_shared_home_dir} )
1237+ end
1238+ end
1239+
11921240 context 'OpenJDK jvm params' do
11931241 let ( :params ) do
11941242 super ( ) . merge (
Original file line number Diff line number Diff line change 11# This ID must be unique across the cluster
2- jira.node.id = <%= $facts['networking']['fqdn'] %>
2+ jira.node.id = <%= $facts['networking']['fqdn'].length > 60 ? { true => $facts['networking']['hostname'], false => $facts['networking']['fqdn'] } %>
33# The location of the shared home directory for all JIRA nodes
44jira.shared.home = <%= $jira::shared_homedir %>
55<% if $jira::ehcache_listener_host { -%>
You can’t perform that action at this time.
0 commit comments