Skip to content

Commit

Permalink
puppet-lint: autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Aug 16, 2020
1 parent 5a48a81 commit 0e9cb61
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 42 deletions.
2 changes: 0 additions & 2 deletions examples/jira_mysql_install.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node default {

class { 'mysql::server':
root_password => 'strongpassword',
}
Expand All @@ -20,5 +19,4 @@
}

include jira::facts

}
2 changes: 0 additions & 2 deletions examples/jira_mysql_nativessl_install.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node default {

$cert = hiera('cert')
$key = hiera('key')

Expand Down Expand Up @@ -57,5 +56,4 @@
}

include jira::facts

}
2 changes: 0 additions & 2 deletions examples/jira_postgres_install.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node default {

class { 'postgresql::globals':
manage_package_repo => true,
version => '9.3',
Expand All @@ -17,5 +16,4 @@
}

include jira::facts

}
6 changes: 2 additions & 4 deletions examples/jira_postgres_nginx_install.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node default {

class { 'nginx': }

-> class { 'postgresql::globals':
Expand Down Expand Up @@ -27,12 +26,12 @@

nginx::resource::upstream { 'jira':
ensure => present,
members => [ 'localhost:8080' ],
members => ['localhost:8080'],
}

nginx::resource::vhost { 'jira_vhost':
ensure => present,
server_name => [ $facts['networking']['ip'], $facts['networking']['fqdn'], $facts['networking']['hostname'] ],
server_name => [$facts['networking']['ip'], $facts['networking']['fqdn'], $facts['networking']['hostname']],
listen_port => '80',
proxy => 'http://jira',
proxy_read_timeout => '300',
Expand All @@ -44,5 +43,4 @@
'proxy_redirect' => 'off',
},
}

}
6 changes: 2 additions & 4 deletions examples/jira_postgres_nginx_ssl_install.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node default {

class { 'nginx': }

-> class { 'postgresql::globals':
Expand Down Expand Up @@ -27,12 +26,12 @@

nginx::resource::upstream { 'jira':
ensure => present,
members => [ 'localhost:8080' ],
members => ['localhost:8080'],
}

nginx::resource::vhost { 'jira_vhost':
ensure => present,
server_name => [ $facts['networking']['ip'], $facts['networking']['fqdn'], $facts['networking']['hostname'] ],
server_name => [$facts['networking']['ip'], $facts['networking']['fqdn'], $facts['networking']['hostname']],
proxy => 'http://jira',
proxy_read_timeout => '300',
rewrite_to_https => true,
Expand All @@ -47,5 +46,4 @@
'proxy_redirect' => 'off',
},
}

}
8 changes: 3 additions & 5 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# limitations under the License.
# -----------------------------------------------------------------------------
class jira::config inherits jira {

File {
owner => $jira::user,
group => $jira::group,
Expand Down Expand Up @@ -59,7 +58,7 @@
-> file { "${jira::homedir}/dbconfig.xml":
content => template("jira/dbconfig.${jira::db}.xml.erb"),
mode => '0600',
require => [ Class['jira::install'],File[$jira::homedir] ],
require => [Class['jira::install'],File[$jira::homedir]],
notify => Class['jira::service'],
}

Expand Down Expand Up @@ -91,17 +90,16 @@
file { "${jira::homedir}/jira-config.properties":
content => template('jira/jira-config.properties.erb'),
mode => '0600',
require => [ Class['jira::install'],File[$jira::homedir] ],
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] ],
require => [Class['jira::install'],File[$jira::homedir]],
notify => Class['jira::service'],
}
}

}
2 changes: 0 additions & 2 deletions manifests/facts.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
},
# lint:endignore
) inherits jira::params {

# Puppet Enterprise supplies its own ruby version if your using it.
# A modern ruby version is required to run the executable fact
if $facts['puppetversion'] =~ /Puppet Enterprise/ {
Expand Down Expand Up @@ -60,5 +59,4 @@
content => template('jira/facts.rb.erb'),
mode => '0500',
}

}
5 changes: 2 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,13 @@
Integer $session_validationinterval = 5,
String $session_lastvalidation = 'session.lastvalidation',
) inherits jira::params {

if $datacenter and !$shared_homedir {
fail("\$shared_homedir must be set when \$datacenter is true")
}

if $tomcat_redirect_https_port {
unless ($tomcat_native_ssl) {
fail('You need to set native_ssl to true when using tomcat_redirect_https_port')
fail('You need to set native_ssl to true when using tomcat_redirect_https_port')
}
}

Expand Down Expand Up @@ -263,7 +262,7 @@
}
}

$merged_jira_config_properties = merge({'jira.websudo.is.disabled' => !$enable_secure_admin_sessions}, $jira_config_properties)
$merged_jira_config_properties = merge( { 'jira.websudo.is.disabled' => !$enable_secure_admin_sessions }, $jira_config_properties)

if $javahome == undef {
fail('You need to specify a value for javahome')
Expand Down
4 changes: 1 addition & 3 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# limitations under the License.
# -----------------------------------------------------------------------------
class jira::install {

include 'archive'

if $jira::manage_user {
Expand All @@ -32,7 +31,6 @@
managehome => true,
uid => $jira::uid,
gid => $jira::gid,

}
}

Expand Down Expand Up @@ -94,7 +92,7 @@
require => [
File[$jira::installdir],
User[$jira::user],
File[$jira::extractdir] ],
File[$jira::extractdir]],
}
}
'archive': {
Expand Down
2 changes: 0 additions & 2 deletions manifests/mysql_connector.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
$installdir = $jira::mysql_connector_install,
$download_url = $jira::mysql_connector_url,
) {

require staging

$file = "${product}-${version}.${format}"
Expand Down Expand Up @@ -34,5 +33,4 @@
ensure => link,
target => "${installdir}/${product}-${version}/${product}-${version}-bin.jar",
}

}
15 changes: 7 additions & 8 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,46 @@
# Defines default values for jira module
#
class jira::params {

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

case $facts['os']['family'] {
/RedHat/: {
if $facts['os']['name'] == 'Amazon' and $facts['os']['release']['major'] =='2018' {
$json_packages = [ 'rubygem-json' ]
$json_packages = ['rubygem-json']
$service_file_location = '/etc/init.d/jira'
$service_file_template = 'jira/jira.initscript.erb'
$service_file_mode = '0755'
$service_lockfile = '/var/lock/subsys/jira'
$service_provider = undef
} elsif versioncmp($facts['os']['release']['major'], '7') >= 0 {
$json_packages = [ 'rubygem-json' ]
$json_packages = ['rubygem-json']
$service_file_location = '/usr/lib/systemd/system/jira.service'
$service_file_template = 'jira/jira.service.erb'
$service_file_mode = '0644'
$service_lockfile = '/var/lock/subsys/jira'
$service_provider = 'systemd'
} elsif versioncmp($facts['os']['release']['major'], '6') >= 0 {
$json_packages = [ 'rubygem-json', 'ruby-json' ]
$json_packages = ['rubygem-json', 'ruby-json']
$service_file_location = '/etc/init.d/jira'
$service_file_template = 'jira/jira.initscript.erb'
$service_file_mode = '0755'
$service_lockfile = '/var/lock/subsys/jira'
$service_provider = undef
} else {
fail("\"${module_name}\" provides no service parameters
fail("\"${module_name}\" provides no service parameters
for \"${facts['os']['family']}\" - \"${$facts['os']['release']['major']}\"")
}
}
/Debian/: {
$json_packages = [ 'ruby-json' ]
$json_packages = ['ruby-json']
$service_file_location = '/lib/systemd/system/jira.service'
$service_file_template = 'jira/jira.service.erb'
$service_file_mode = '0644'
$service_lockfile = '/var/lock/subsys/jira'
$service_provider = 'systemd'
}
default: {
$json_packages = [ 'rubygem-json', 'ruby-json' ]
$json_packages = ['rubygem-json', 'ruby-json']
$service_file_location = '/etc/init.d/jira'
$service_file_template = 'jira/jira.initscript.erb'
$service_file_mode = '0755'
Expand Down
3 changes: 1 addition & 2 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#-----------------------------------------------------------------------------
class jira::service(
class jira::service (

Boolean $service_manage = $jira::service_manage,
String $service_ensure = $jira::service_ensure,
Expand All @@ -27,7 +27,6 @@
$service_provider = $jira::params::service_provider,

) inherits jira::params {

file { $service_file_location:
content => template($service_file_template),
mode => $service_file_mode,
Expand Down
5 changes: 2 additions & 3 deletions manifests/sso.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Install confluence SSO via crowd, See README.md for more.
#
class jira::sso(
class jira::sso (
$application_name = $jira::application_name,
$application_password = $jira::application_password,
Variant[Stdlib::HTTPUrl, Stdlib::HTTPSUrl] $application_login_url = $jira::application_login_url,
Expand All @@ -13,9 +13,8 @@
$session_validationinterval = $jira::session_validationinterval,
$session_lastvalidation = $jira::session_lastvalidation,
) {

file { "${jira::webappdir}/atlassian-jira/WEB-INF/classes/crowd.properties":
ensure => present,
ensure => file,
content => template('jira/crowd.properties'),
mode => '0660',
owner => $jira::user,
Expand Down

0 comments on commit 0e9cb61

Please sign in to comment.