Skip to content

Commit

Permalink
Merge pull request #86 from tykeal/config_files
Browse files Browse the repository at this point in the history
Fix nexus config path and that the file exists
  • Loading branch information
PaulFurtado authored Jan 24, 2017
2 parents 8547e4e + 7115727 commit 7dffd13
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
17 changes: 15 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,27 @@
$version = $::nexus::version,
) {

if $version !~ /\d.*/ or versioncmp($version, '3.0.0') >= 0 {
if $version !~ /\d.*/ or versioncmp($version, '3.1.0') >= 0 {
# Per the Sonatype documentation the custom nexus properties file is
# {karaf.data}/etc/nexus.properties where {karaf.data} is the work dir
$conf_path = 'etc/nexus.properties'
$nexus_properties_file = "${nexus_work_dir}/${conf_path}"
}
elsif versioncmp($version, '3.0.0') >= 0 {
$conf_path = 'etc/org.sonatype.nexus.cfg'
$nexus_properties_file = "${nexus_root}/${nexus_home_dir}/${conf_path}"
} else {
$conf_path = 'conf/nexus.properties'
$nexus_properties_file = "${nexus_root}/${nexus_home_dir}/${conf_path}"
}
$nexus_properties_file = "${nexus_root}/${nexus_home_dir}/${conf_path}"
$nexus_data_dir = "${nexus_root}/${nexus_home_dir}/data"

# Nexus >=3.x do no necesarily have a properties file in place to
# modify. Make sure that there is at least a minmal file there
file { $nexus_properties_file:
ensure => present,
}

file_line{ 'nexus-application-host':
path => $nexus_properties_file,
match => '^application-host',
Expand Down
6 changes: 5 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@
if $nexus_work_dir != undef {
$real_nexus_work_dir = $nexus_work_dir
} else {
$real_nexus_work_dir = "${nexus_root}/sonatype-work/nexus"
if $version !~ /\d.*/ or versioncmp($version, '3.1.0') >= 0 {
$real_nexus_work_dir = "${nexus_root}/sonatype-work/nexus3"
} else {
$real_nexus_work_dir = "${nexus_root}/sonatype-work/nexus"
}
}

# Determine if Nexus Pro should be deployed instead of OSS
Expand Down
11 changes: 11 additions & 0 deletions manifests/package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@
selinux_ignore_defaults => $nexus_selinux_ignore_defaults,
require => Exec[ 'nexus-untar']
}

# Nexus 3 needs to have a nexus_work_dir/etc for the properties file
if $version !~ /\d.*/ or versioncmp($version, '3.1.0') >= 0 {
file { "${nexus_work_dir}/etc":
ensure => directory,
owner => $nexus_user,
group => $nexus_group,
recurse => $nexus_work_recurse,
selinux_ignore_defaults => $nexus_selinux_ignore_defaults,
}
}
}

file{ $nexus_home:
Expand Down

2 comments on commit 7dffd13

@gbloquel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump version to 1.7.2 seems to have forgotten.
Metadata.json and changelog are already in 1.7.1 but a git tag 1.7.2 exists.

@kgeis
Copy link

@kgeis kgeis commented on 7dffd13 Oct 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PaulFurtado or @kenbreeman, could you release 1.7.3 where the Metadata.json version matches the git tag? Version 1.7.2 is not available via the Puppet Forge because it has a cached 1.7.1 from before you tagged 1.7.2 with the same version in metadata.

Please sign in to comment.