Puppet Class: bitbucket
- Inherited by:
-
bitbucket::facts
- Defined in:
- manifests/init.pp
Overview
Class: bitbucket
This modules installs Atlassian bitbucket.
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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'manifests/init.pp', line 5
class bitbucket(
# JVM Settings
$javahome = undef,
$jvm_xms = '256m',
$jvm_xmx = '1024m',
$jvm_permgen = '256m',
$jvm_optional = '-XX:-HeapDumpOnOutOfMemoryError',
$jvm_support_recommended_args = '',
$java_opts = '',
$umask = undef,
$additional_env = undef,
# Bitbucket Settings
$version = '7.2.2',
$product = 'bitbucket',
$format = 'tar.gz',
$installdir = '/opt/bitbucket',
$homedir = '/home/bitbucket',
$context_path = '',
$tomcat_port = 7990,
$tomcat_ssl = false,
$logdir = "${homedir}/log",
$log_maxhistory = '31', # days
$log_maxsize = '25MB',
# User and Group Management Settings
$manage_usr_grp = true,
$user = 'atlbitbucket',
$group = 'atlbitbucket',
$uid = undef,
$gid = undef,
# Bitbucket 4.6.0 initialization configurations
$display_name = 'bitbucket',
$base_url = "https://${::fqdn}",
$license = '',
$sysadmin_username = 'admin',
$sysadmin_password = 'bitbucket',
$sysadmin_name = 'Bitbucket Admin',
$sysadmin_email = '',
$config_properties = {},
# Database Settings
$dbuser = 'bitbucket',
$dbpassword = 'password',
$dburl = 'jdbc:postgresql://localhost:5432/bitbucket',
$dbdriver = 'org.postgresql.Driver',
# Data Center Settings
$hazelcast_network = undef,
$hazelcast_group_name = undef,
$hazelcast_group_password = undef,
$elasticsearch_baseurl = undef,
$elasticsearch_username = undef,
$elasticsearch_password = undef,
# Misc Settings
$download_url = 'https://product-downloads.atlassian.com/software/stash/downloads',
$checksum = undef,
# Backup Settings
$manage_backup = true,
$backup_ensure = 'present',
$backupclient_url = 'https://maven.atlassian.com/content/groups/public/com/atlassian/bitbucket/server/backup/bitbucket-backup-distribution',
$backup_format = 'zip',
$backupclient_version = '3.6.0',
$backup_home = '/opt/bitbucket-backup',
$backupuser = 'admin',
$backuppass = 'password',
$backup_schedule_day = '1-5',
$backup_schedule_hour = '5',
$backup_schedule_minute = '0',
$backup_keep_age = '4w',
$backup_base_url = "${bitbucket::base_url}",
$backup_keystore = "${bitbucket::homedir}/shared/config/ssl-keystore",
# Manage service
$service_manage = true,
$service_ensure = running,
$service_enable = true,
$service_options = '',
# Reverse https proxy
$proxy = {},
# Command to stop bitbucket in preparation to updgrade. # This is configurable
# incase the bitbucket service is managed outside of puppet. eg: using the
# puppetlabs-corosync module: 'crm resource stop bitbucket && sleep 15'
$stop_bitbucket = 'service bitbucket stop && sleep 15',
# Choose whether to use nanliu-staging, or puppet-archive
$deploy_module = 'archive',
) {
validate_hash($config_properties)
include ::bitbucket::params
Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] }
$webappdir = "${installdir}/atlassian-${product}-${version}"
if $::bitbucket_version {
# If the running version of bitbucket is less than the expected version of bitbucket
# Shut it down in preparation for upgrade.
if $::bitbucket_version != '-1' and
versioncmp($version, $::bitbucket_version) > 0 {
notify { 'Attempting to upgrade bitbucket': }
exec { $stop_bitbucket: }
if versioncmp($version, '3.2.0') > 0 {
exec { "rm -f ${homedir}/stash-config.properties": }
}
}
}
anchor { 'bitbucket::start':
} ->
class { '::bitbucket::install': webappdir => $webappdir, } ->
class { '::bitbucket::config': } ~>
class { '::bitbucket::service': } ->
class { '::bitbucket::backup': } ->
anchor { 'bitbucket::end': }
}
|