Puppet Class: nexus::config
- Defined in:
- manifests/config.pp
Overview
Class: nexus::config
Configure nexus.
Parameters
NONE
Examples
class{ ‘nexus::config’: }
Authors
Tom McLaughlin <tmclaughlin@hubspot.com>
Copyright
Copyright 2013 Hubspot
[View source]
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 |
# File 'manifests/config.pp', line 21
class nexus::config(
$nexus_root = $::nexus::nexus_root,
$nexus_home_dir = $::nexus::nexus_home_dir,
$nexus_host = $::nexus::nexus_host,
$nexus_port = $::nexus::nexus_port,
$nexus_context = $::nexus::nexus_context,
$nexus_work_dir = $::nexus::nexus_work_dir,
$nexus_data_folder = $::nexus::nexus_data_folder,
$version = $::nexus::version,
) {
if $version !~ /\d.*/ or versioncmp($version, '3.0.0') >= 0 {
$conf_path = 'etc/org.sonatype.nexus.cfg'
} else {
$conf_path = 'conf/nexus.properties'
}
$nexus_properties_file = "${nexus_root}/${nexus_home_dir}/${conf_path}"
$nexus_data_dir = "${nexus_root}/${nexus_home_dir}/data"
file_line{ 'nexus-application-host':
path => $nexus_properties_file,
match => '^application-host',
line => "application-host=${nexus_host}"
}
file_line{ 'nexus-application-port':
path => $nexus_properties_file,
match => '^application-port',
line => "application-port=${nexus_port}"
}
file_line{ 'nexus-webapp-context-path':
path => $nexus_properties_file,
match => '^nexus-webapp-context-path',
line => "nexus-webapp-context-path=${nexus_context}"
}
file_line{ 'nexus-work':
path => $nexus_properties_file,
match => '^nexus-work',
line => "nexus-work=${nexus_work_dir}"
}
if $nexus_data_folder {
file{ $nexus_data_dir :
ensure => 'link',
target => $nexus_data_folder,
force => true,
notify => Service['nexus']
}
}
}
|