Puppet Class: confluence

Defined in:
manifests/init.pp

Overview

Class: confluence

Install confluence, See README.md for more.

Parameters:

  • javahome (Any)
  • jvm_xms (Any) (defaults to: '256m')
  • jvm_xmx (Any) (defaults to: '1024m')
  • jvm_permgen (Any) (defaults to: '256m')
  • java_opts (Any) (defaults to: '')
  • version (Any) (defaults to: '5.5.6')
  • product (Any) (defaults to: 'confluence')
  • format (Any) (defaults to: 'tar.gz')
  • installdir (Any) (defaults to: '/opt/confluence')
  • homedir (Any) (defaults to: '/home/confluence')
  • user (Any) (defaults to: 'confluence')
  • group (Any) (defaults to: 'confluence')
  • uid (Any) (defaults to: undef)
  • gid (Any) (defaults to: undef)
  • shell (Any) (defaults to: '/bin/true')
  • downloadURL (Any) (defaults to: 'http://www.atlassian.com/software/confluence/downloads/binary')
  • staging_or_deploy (Any) (defaults to: 'staging')
  • manage_service (Any) (defaults to: true)
  • manage_server_xml (Any) (defaults to: 'augeas')
  • tomcat_port (Any) (defaults to: 8090)
  • tomcat_max_threads (Any) (defaults to: 150)
  • tomcat_accept_count (Any) (defaults to: 100)
  • tomcat_proxy (Any) (defaults to: {})
  • tomcat_extras (Any) (defaults to: {})
  • stop_confluence (Any) (defaults to: 'service confluence stop && sleep 15')
  • facts_ensure (Any) (defaults to: 'present')


5
6
7
8
9
10
11
12
13
14
15
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
# File 'manifests/init.pp', line 5

class confluence (

  # JVM Settings
  $javahome,
  $jvm_xms      = '256m',
  $jvm_xmx      = '1024m',
  $jvm_permgen  = '256m',
  $java_opts    = '',

  # Confluence Settings
  $version      = '5.5.6',
  $product      = 'confluence',
  $format       = 'tar.gz',
  $installdir   = '/opt/confluence',
  $homedir      = '/home/confluence',
  $user         = 'confluence',
  $group        = 'confluence',
  $uid          = undef,
  $gid          = undef,
  $shell        = '/bin/true',

  # Misc Settings
  $downloadURL  = 'http://www.atlassian.com/software/confluence/downloads/binary',

  # Choose whether to use nanliu-staging, or mkrakowitzer-deploy
  # Defaults to nanliu-staging as it is puppetlabs approved.
  $staging_or_deploy = 'staging',

  # Manage confluence server
  $manage_service = true,

  # Tomcat Tunables
  # Should we use augeas to manage server.xml or a template file
  $manage_server_xml   = 'augeas',
  $tomcat_port         = 8090,
  $tomcat_max_threads  = 150,
  $tomcat_accept_count = 100,
  # Reverse https proxy setting for tomcat
  $tomcat_proxy = {},
  # Any additional tomcat params for server.xml
  $tomcat_extras = {},

  # Command to stop confluence in preparation to updgrade. This is configurable
  # incase the confluence service is managed outside of puppet. eg: using the
  # puppetlabs-corosync module: 'crm resource stop confluence && sleep 15'
  $stop_confluence = 'service confluence stop && sleep 15',

  # Enable confluence version fact for running instance
  # This required for upgrades
  $facts_ensure = 'present',
) {
  validate_re($version, '^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)(|[a-z])$')
  validate_absolute_path($installdir)
  validate_absolute_path($homedir)

  validate_re($manage_server_xml, ['^augeas$', '^template$' ],
    'manage_server_xml must be "augeas" or "template"')
  validate_hash($tomcat_proxy)
  validate_hash($tomcat_extras)

  Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] }

  $webappdir    = "${installdir}/atlassian-${product}-${version}"

  if $::confluence_version {
    # If the running version of CONFLUENCE is less than the expected version of CONFLUENCE
    # Shut it down in preparation for upgrade.
    if versioncmp($version, $::confluence_version) > 0 {
      notify { 'Attempting to upgrade CONFLUENCE': }
      exec { $stop_confluence: before => Anchor['confluence::start'] }
    }
  }

  anchor { 'confluence::start':
  } ->
  class { 'confluence::facts':
  } ->
  class { 'confluence::install':
  } ->
  class { 'confluence::config':
  } ~>
  class { 'confluence::service':
  } ->
  anchor { 'confluence::end': }

}