Puppet Class: jira::config

Inherits:
jira
Defined in:
manifests/config.pp

Overview


Copyright (c) 2012 Bryce Johnson

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'manifests/config.pp', line 16

class jira::config inherits jira {

  File {
    owner => $jira::user,
    group => $jira::group,
  }

  if $jira::validation_query == undef {
    $validation_query = $jira::db ? {
      'postgresql' => 'select version();',
      'mysql'      => 'select 1',
      'oracle'     => 'select 1 from dual',
      'sqlserver'  => 'select 1',
      'h2'         => 'select 1',
    }
  }
  if $jira::time_between_eviction_runs == undef {
    $time_between_eviction_runs = $jira::db ? {
      'postgresql' => '30000',
      'mysql'      => '300000',
      'oracle'     => '300000',
      'sqlserver'  => '300000',
      'h2'         => '5000',
    }
  }

  file { "${jira::webappdir}/bin/user.sh":
    content => template('jira/user.sh.erb'),
    mode    => '0755',
    require => [
      Class['jira::install'],
      File[$jira::webappdir],
      File[$jira::homedir],
    ],
  }

  -> file { "${jira::webappdir}/bin/setenv.sh":
    content => template('jira/setenv.sh.erb'),
    mode    => '0755',
    require => Class['jira::install'],
    notify  => Class['jira::service'],
  }

  -> file { "${jira::homedir}/dbconfig.xml":
    content => template("jira/dbconfig.${jira::db}.xml.erb"),
    mode    => '0600',
    require => [ Class['jira::install'],File[$jira::homedir] ],
    notify  => Class['jira::service'],
  }

  if $jira::script_check_java_manage {
    file { "${jira::webappdir}/bin/check-java.sh":
      content => template($jira::script_check_java_template),
      mode    => '0755',
      require => [
        Class['jira::install'],
        File["${jira::webappdir}/bin/setenv.sh"],
      ],
      notify  => Class['jira::service'],
    }
  }

  file { "${jira::webappdir}/conf/server.xml":
    content => template('jira/server.xml.erb'),
    mode    => '0600',
    require => Class['jira::install'],
    notify  => Class['jira::service'],
  }
  -> file { "${jira::webappdir}/conf/context.xml":
    content => template('jira/context.xml.erb'),
    mode    => '0600',
    require => Class['jira::install'],
    notify  => Class['jira::service'],
  }

  file { "${jira::homedir}/jira-config.properties":
    content => template('jira/jira-config.properties.erb'),
    mode    => '0600',
    require => [ Class['jira::install'],File[$jira::homedir] ],
    notify  => Class['jira::service'],
  }

  if $jira::datacenter {
    file { "${jira::homedir}/cluster.properties":
      content => template('jira/cluster.properties.erb'),
      mode    => '0600',
      require => [ Class['jira::install'],File[$jira::homedir] ],
      notify  => Class['jira::service'],
    }
  }

}