diff --git a/manifests/init.pp b/manifests/init.pp index f7079f2..e5717a6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -11,10 +11,12 @@ # Spencer Herzberg # class groovy ( - $version = $groovy::params::version, - $base_url = $groovy::params::base_url, - $target = $groovy::params::target, - $timeout = $groovy::params::timeout, + $version = $groovy::params::version, + $base_url = $groovy::params::base_url, + $target = $groovy::params::target, + $manage_target = $groovy::params::manage_target, + $manage_unzip = $groovy::params::manage_unzip, + $timeout = $groovy::params::timeout, ) inherits groovy::params { include stdlib @@ -31,17 +33,27 @@ content => template("${module_name}/groovy.sh.erb"), } + file { '/etc/profile.d/groovy.csh': + ensure => file, + mode => '0644', + content => template("${module_name}/groovy.csh.erb"), + } + staging::file { $groovy_filename: source => "${base_url}/${groovy_filename}", timeout => $timeout, } - package { 'unzip': - ensure => present, + if $manage_unzip { + package { 'unzip': + ensure => present, + } } - file { $target: - ensure => directory, + if $manage_target { + file { $target: + ensure => directory, + } } staging::extract { $groovy_filename: diff --git a/manifests/params.pp b/manifests/params.pp index 7acce0f..4772ddc 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,8 +1,10 @@ # # default parameters for the groovy class class groovy::params { - $version = '2.3.1' - $base_url = 'http://dl.bintray.com/groovy/maven/' - $target = '/opt' - $timeout = 360 + $version = '2.3.1' + $base_url = 'http://dl.bintray.com/groovy/maven/' + $target = '/opt' + $manage_target = true + $manage_unzip = true + $timeout = 360 } diff --git a/templates/groovy.csh.erb b/templates/groovy.csh.erb new file mode 100644 index 0000000..8a75a22 --- /dev/null +++ b/templates/groovy.csh.erb @@ -0,0 +1,2 @@ +setenv GROOVY_HOME <%= @groovy_dir %> +setenv PATH "$PATH:<%= @groovy_dir %>/bin"