diff --git a/.gitignore b/.gitignore index 2e5dd04..e1caa44 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ Gemfile.lock pkg spec/fixtures/ .vagrant/ +.idea/ log/ vendor/ bin/ diff --git a/manifests/service.pp b/manifests/service.pp index 0d65d71..3fa2eb4 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -34,16 +34,17 @@ # Copyright 2013 Hubspot # class nexus::service ( - $nexus_home = $::nexus::nexus_home, - $nexus_user = $::nexus::nexus_user, + $nexus_home = $::nexus::nexus_home, + $nexus_user = $::nexus::nexus_user, $nexus_group = $::nexus::nexus_group, - $version = $::nexus::version, + $version = $::nexus::version, ) { $nexus_script = "${nexus_home}/bin/nexus" if ($::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '8.0') > 0) or - ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '15.04') > 0) or - (($::operatingsystem == 'CentOS' or $::operatingsystem == 'RedHat') and versioncmp($::operatingsystemmajrelease, '7') >= 0) { + ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '15.04') > 0) or + (($::operatingsystem == 'CentOS' or $::operatingsystem == 'RedHat' or $::operatingsystem == 'OracleLinux') and + versioncmp($::operatingsystemmajrelease, '7') >= 0) { file { '/lib/systemd/system/nexus.service': mode => '0644', owner => 'root', @@ -58,13 +59,13 @@ } else { - file_line{ 'nexus_NEXUS_HOME': + file_line { 'nexus_NEXUS_HOME': path => $nexus_script, match => '^#?NEXUS_HOME=', line => "NEXUS_HOME=${nexus_home}", } - file{ '/etc/init.d/nexus': + file { '/etc/init.d/nexus': ensure => 'link', target => $nexus_script, require => [ @@ -77,7 +78,7 @@ if $version !~ /\d.*/ or versioncmp($version, '3.0.0') >= 0 { $status_line = "env run_as_user=${nexus_user} /etc/init.d/nexus status" - file_line{ 'nexus_RUN_AS_USER': + file_line { 'nexus_RUN_AS_USER': path => $nexus_script, match => '^run_as_user\=', line => "run_as_user=\${run_as_user:-${nexus_user}}", @@ -86,20 +87,20 @@ } else { $status_line = 'env run_as_user=root /etc/init.d/nexus status' - file_line{ 'nexus_RUN_AS_USER': + file_line { 'nexus_RUN_AS_USER': path => $nexus_script, match => '^#?RUN_AS_USER=', line => "RUN_AS_USER=\${run_as_user:-${nexus_user}}", } } - service{ 'nexus': + service { 'nexus': ensure => running, enable => true, status => $status_line, require => [File['/etc/init.d/nexus'], File_line['nexus_NEXUS_HOME'], - File_line['nexus_RUN_AS_USER'],] + File_line['nexus_RUN_AS_USER'], ] } } }