Skip to content

Commit

Permalink
Merge pull request #48 from brycejohnson/f3792625/1.1.5
Browse files Browse the repository at this point in the history
F3792625/1.1.5
  • Loading branch information
mkrakowitzer committed Jan 20, 2015
2 parents eab2ce7 + ec91c1c commit 5ebcbc6
Show file tree
Hide file tree
Showing 17 changed files with 356 additions and 94 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
##2014-11-18 - Release 1.1.4
##2014-01-21 - Release 1.1.5
- Add beaker tests for MySQL
- Added support for Oracle and Scientific Linux
- Bump jira version to 6.3.13
- Add support for parameter 'contextpath'
- Add class to install MySQL Java connector from mysql.com
- Add support for oracle database

Thanks to Oliver Bertuch for his contributions.

##2014-01-17 - Release 1.1.4
- Parameterize the lockfile variable in the init script
- Autoinstall MySql Connector/J Driver
- Add parameter stop_jira
Expand Down
68 changes: 47 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ This module installs/upgrades Atlassian's Enterprise Issue Tracking and project
<a name="JIRA-prerequisites">
###JIRA Prerequisites

* JIRA requires a Java Developers Kit (JDK) or Java Run-time Environment (JRE) platform to be installed on your server's operating system. Oracle JDK / JRE (formerly Sun JDK / JRE) versions 7 and 8 are currently supported by Atlassian.
* JIRA requires a Java Developers Kit (JDK) or Java Run-time Environment (JRE) platform to be installed on your server's operating system. Oracle JDK / JRE (formerly Sun JDK / JRE) versions 7 and 8 are currently supported by Atlassian.

* JIRA requires a relational database to store its issue data. This module currently supports PostgreSQL 8.4 to 9.x and MySQL 5.x. We suggest using puppetlabs-postgresql/puppetlabs-mysql modules to configure/manage the database. The module uses PostgreSQL as a default.
* JIRA requires a relational database to store its issue data. This module currently supports PostgreSQL 8.4 to 9.x and MySQL 5.x and Oracle 11g. We suggest using puppetlabs-postgresql/puppetlabs-mysql modules to configure/manage the database. The module uses PostgreSQL as a default.

* Whilst not required, for production use we recommend using nginx/apache as a reverse proxy to JIRA. We suggest using the jfryman/nginx puppet module.

Expand All @@ -42,10 +42,12 @@ This module installs/upgrades Atlassian's Enterprise Issue Tracking and project

If installing to an existing JIRA instance, it is your responsibility to backup your database. We also recommend that you backup your JIRA home directory and that you align your current JIRA version with the version you intend to use with puppet JIRA module.

You must have your database setup with the account user that JIRA will use. This can be done using the puppetlabs-postgresql and puppetlabs-mysql modules.
You must have your database setup with the account user that JIRA will use. This can be done using the puppetlabs-postgresql and puppetlabs-mysql modules.

When using this module to upgrade JIRA, please make sure you have a database/JIRA home backup.

When using MySQL, We call the jira::mysql_connector class to install the MySQL java connector directory from mysql.com as per Atlassian's documented recommendations.

<a name="beginning-with-JIRA">
###Beginning with JIRA

Expand Down Expand Up @@ -102,6 +104,7 @@ mkrakowitzer-deploy has been replaced with nanliu-staging as the default module
* `jira::install`: Installs JIRA binaries
* `jira::config`: Modifies jira/tomcat configuration files
* `jira::service`: Manage the JIRA service.
* `jira::mysql_connector`: Install/Manage the MySQL Java connector

###Parameters

Expand All @@ -113,7 +116,7 @@ Specifies the version of JIRA to install, defaults to latest available at time o

#####`$product`

Product name, defaults to JIRA
Product name, defaults to jira

#####`$format`

Expand Down Expand Up @@ -147,7 +150,7 @@ The gid of the JIRA user, defaults to next available (undef)

#####`$db`

Which database to use for JIRA, defaults to 'postgresql'
Which database to use for JIRA, defaults to 'postgresql'. Can be 'postgresql', 'mysql' or 'oracle'.

#####`$dbuser`

Expand All @@ -163,31 +166,26 @@ The hostname of the database server, defaults to 'localhost'

#####`$dbname`

The name of the database, defaults to 'jira'
The name of the database, defaults to 'jira'. If using oracle this should be the SID.

#####`$dbport`

The port of the database, defaults to '5432'
The port of the database, defaults to '5432'. MySQL runs on '3306'. Oracle runs on '1521'.

#####`$dbdriver`

The database driver to use, defaults to 'org.postgresql.Driver'
The database driver to use, defaults to 'org.postgresql.Driver'. Can be 'org.postgresql.Driver', 'com.mysql.jdbc.Driver' or 'oracle.jdbc.OracleDriver'.

#####`$dbtype`

Database type, defaults to 'postgres72'
Database type, defaults to 'postgres72'. Can be 'postgres72', 'mysql' or 'oracle10g'. Atlassian only supports Oracle 11g, even so this value should be as documented here.

#####`$poolsize`

The connection pool size to the database, defaults to 20

#####`$mysql_connector_package`

Package name for the MySQL Connector/J driver. Will be automatically installed if set and $dbtype = 'mysql'. Defaults to 'mysql-connector-java' on Redhat and 'libmysql-java' on Debian.

#####`$mysql_connector_jar`

Path to the JAR for the MySQL Connector/J driver. Defaults to '/usr/share/java/mysql-connector-java.jar' on Redhat and '/usr/share/java/mysql.jar' on Debian.
#####`$dburl`
This parameter is not required nor do we recommend setting it. However it can be used to customize the database connection string.

#####`$enable_connection_pooling`

Expand Down Expand Up @@ -237,6 +235,27 @@ defaults to true

defaults to true

####MySQL Java Connector parameters####

#####`mysql_connector_manage`
Manage the MySQL Java Connector with the JIRA module, defaults to 'true'

#####`mysql_connector_version`
Specifies the version of MySQL Java Connector you would like installed. Defaults to '5.1.34',

#####`$mysql_connector_product`
Product name, defaults to 'mysql-connector-java'

#####`$mysql_connector_format`
The default file format of the MySQL Java Connector install file, defaults to tar.gz

#####`$mysql_connector_install`
Installation directory of the MySQL connector. Defaults to '/opt/MySQL-connector'

#####`$mysql_connector_URL`
The URL used to download the MySQL Java Connector installation file.
Defaults to 'http://cdn.mysql.com/Downloads/Connector-J'

####JVM Java parameters####

#####`$javahome`
Expand Down Expand Up @@ -292,7 +311,7 @@ Manage the JIRA service, defaults to 'running'
Defaults to 'true'

#####`$stop_jira`
If the jira service is managed outside of puppet the stop_jira paramater can be used to shut down jira for upgrades. Defaults to 'service jira stop && sleep 15'
If the jira service is managed outside of puppet the stop_jira parameter can be used to shut down jira for upgrades. Defaults to 'service jira stop && sleep 15'

#####`$proxy = {}`

Expand Down Expand Up @@ -335,7 +354,7 @@ Defaults to '100'

### A Hiera example

This example is used in production for 2000 users in an traditional enterprise environment. Your milage may vary. The dbpassword can be stored using eyaml hiera extension.
This example is used in production for 2000 users in an traditional enterprise environment. Your mileage may vary. The dbpassword can be stored using eyaml hiera extension.

```yaml
jira::version: '6.2.7'
Expand Down Expand Up @@ -392,10 +411,17 @@ Enable external facts for puppet version. These facts are required to be enabled
The puppetlabs repositories can be found at:
http://yum.puppetlabs.com/ and http://apt.puppetlabs.com/

* RedHat / CentOS 5/6/7
* Ubuntu 12.04 / 14.04
* RedHat 6/7
* CentOS 6/7
* Scientific 6/7
* Oracle Linux 6/7
* Ubuntu 12.04/14.04
* Debian 7

* PostgreSQL
* MySQL 5.x
* Oracle 11G with Oracle 11.2.x drivers

We plan to support other Linux distributions and possibly Windows in the near future.

##Development
Expand Down Expand Up @@ -433,7 +459,7 @@ BEAKER_set=centos-70-x64 bundle exec rake beaker
BEAKER_set=centos-64-x64-pe bundle exec rake beaker
```

To save build time it is useful to host the installation files locally on a webserver. You can use the download_url environment variable to overwrite the default.
To save build time it is useful to host the installation files locally on a web server. You can use the download_url environment variable to overwrite the default.

```bash
export download_url="'http://my.local.server/'"
Expand Down
2 changes: 2 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
$validationQuery = $jira::db ? {
'postgresql' => 'select version();',
'mysql' => 'select 1',
'oracle' => 'select 1 from dual',
}
}
if $jira::timeBetweenEvictionRuns == undef {
$timeBetweenEvictionRuns = $jira::db ? {
'postgresql' => '30000',
'mysql' => '300000',
'oracle' => '300000',
}
}

Expand Down
14 changes: 11 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
class jira (

# Jira Settings
$version = '6.3.4a',
$version = '6.3.13',
$product = 'jira',
$format = 'tar.gz',
$installdir = '/opt/jira',
Expand All @@ -54,8 +54,15 @@
$dbtype = 'postgres72',
$dburl = undef,
$poolsize = '20',
$mysql_connector_package = $jira::params::mysql_connector_package,
$mysql_connector_jar = $jira::params::mysql_connector_jar,

# MySQL Connector Settings
$mysql_connector_manage = true,
$mysql_connector_version = '5.1.34',
$mysql_connector_product = 'mysql-connector-java',
$mysql_connector_format = 'tar.gz',
$mysql_connector_install = '/opt/MySQL-connector',
$mysql_connector_URL = 'http://cdn.mysql.com/Downloads/Connector-J',


# Configure database settings if you are pooling connections
$enable_connection_pooling = false,
Expand Down Expand Up @@ -131,6 +138,7 @@
$dburl_real = $db ? {
'postgresql' => "jdbc:${db}://${dbserver}:${dbport}/${dbname}",
'mysql' => "jdbc:${db}://${dbserver}:${dbport}/${dbname}?useUnicode=true&amp;characterEncoding=UTF8&amp;sessionVariables=storage_engine=InnoDB",
'oracle' => "jdbc::${db}:thin:@${dbserver}:${dbport}:${dbname}"
}
}

Expand Down
17 changes: 9 additions & 8 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,15 @@
subscribe => User[$jira::user]
}

if $jira::db == 'mysql' and $jira::mysql_connector_package {
package { $jira::mysql_connector_package:
ensure => installed,
} ->

file { "${jira::webappdir}/lib/mysql-connector-java.jar":
ensure => link,
target => $jira::mysql_connector_jar,
if $jira::db == 'mysql' and $jira::mysql_connector_manage {
if $jira::staging_or_deploy == 'staging' {
class { 'jira::mysql_connector':
require => Staging::Extract[$file],
}
} elsif $jira::staging_or_deploy == 'deploy' {
class { 'jira::mysql_connector':
require => Deploy::File[$file],
}
}
}
}
38 changes: 38 additions & 0 deletions manifests/mysql_connector.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Class to install the MySQL Java connector
class jira::mysql_connector (
$version = $jira::mysql_connector_version,
$product = $jira::mysql_connector_product,
$format = $jira::mysql_connector_format,
$installdir = $jira::mysql_connector_install,
$downloadURL = $jira::mysql_connector_URL,
) {

require staging

$file = "${product}-${version}.${format}"

if ! defined(File[$installdir]) {
file { $installdir:
ensure => 'directory',
owner => root,
group => root,
before => Staging::File[$file]
}
}

staging::file { $file:
source => "${downloadURL}/${file}",
timeout => 300,
} ->

staging::extract { $file:
target => $installdir,
creates => "${installdir}/${product}-${version}",
} ->

file { "${jira::webappdir}/lib/mysql-connector-java.jar":
ensure => link,
target => "${installdir}/${product}-${version}/${product}-${version}-bin.jar",
}

}
6 changes: 0 additions & 6 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,18 @@
case "${::osfamily}${::operatingsystemmajrelease}" {
/RedHat7/: {
$json_packages = 'rubygem-json'
$mysql_connector_package = 'mysql-connector-java'
$mysql_connector_jar = '/usr/share/java/mysql-connector-java.jar'
$service_file_location = '/usr/lib/systemd/system/jira.service'
$service_file_template = 'jira/jira.service.erb'
$service_lockfile = '/var/lock/subsys/jira'
}
/Debian/: {
$json_packages = [ 'rubygem-json', 'ruby-json' ]
$mysql_connector_package = 'libmysql-java'
$mysql_connector_jar = '/usr/share/java/mysql.jar'
$service_file_location = '/etc/init.d/jira'
$service_file_template = 'jira/jira.initscript.erb'
$service_lockfile = '/var/lock/jira'
}
default: {
$json_packages = [ 'rubygem-json', 'ruby-json' ]
$mysql_connector_package = 'mysql-connector-java'
$mysql_connector_jar = '/usr/share/java/mysql-connector-java.jar'
$service_file_location = '/etc/init.d/jira'
$service_file_template = 'jira/jira.initscript.erb'
$service_lockfile = '/var/lock/subsys/jira'
Expand Down
16 changes: 15 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mkrakowitzer-jira",
"version": "1.1.4",
"version": "1.1.5",
"author": "brycejohnson",
"summary": "Module to install Jira",
"license": "Apache-2.0",
Expand Down Expand Up @@ -47,6 +47,20 @@
"7"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"6",
"7"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"6",
"7"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
Expand Down

0 comments on commit 5ebcbc6

Please sign in to comment.