Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy / environment support for tomcat::install #173

Merged
merged 1 commit into from Dec 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -841,6 +841,11 @@ Valid options: a string containing a `puppet://`, `http(s)://`, or `ftp://` URL.
##### `source_strip_first_dir`
Specifies whether to strip the topmost directory of the tarball when unpacking it. Only valid if `install_from_source` is set to `true`. Valid options: `true` and `false`. Default: `true`.

##### `environment`
Environment variables for settings such as http_proxy, https_proxy, or ftp_proxy. These are passed through to the staging
module and then to the underlying exec(s), so it follows the same format of the exec type `environment`
https://docs.puppet.com/puppet/latest/reference/type.html#exec-attribute-environment

##### `user`
Specifies the owner of the source installation directory. Default: `$::tomcat::user`

Expand Down
2 changes: 2 additions & 0 deletions manifests/install.pp
Expand Up @@ -6,6 +6,7 @@
# source options
$source_url = undef,
$source_strip_first_dir = true,
$environment = undef,
$user = undef,
$group = undef,
$manage_user = undef,
Expand Down Expand Up @@ -44,6 +45,7 @@
manage_home => $_manage_home,
source_url => $source_url,
source_strip_first_dir => $source_strip_first_dir,
environment => $environment,
user => $_user,
group => $_group,
}
Expand Down
20 changes: 12 additions & 8 deletions manifests/install/source.pp
Expand Up @@ -9,13 +9,15 @@
# the first directory when unpacking the source tarball. Defaults to true
# when installing from source on non-Solaris systems. Requires puppet/staging
# > 0.4.0
# - $environment is variables for settings such as http_proxy, https_proxy, or ftp_proxy
define tomcat::install::source (
$catalina_home,
$manage_home,
$source_url,
$source_strip_first_dir,
$user,
$group,
$environment = undef,
) {
tag(sha1($catalina_home))
include ::staging
Expand All @@ -39,7 +41,8 @@
}

ensure_resource('staging::file',$filename, {
'source' => $source_url,
'source' => $source_url,
'environment' => $environment,
})

# FM-5578 workaround for strict umodes
Expand All @@ -53,12 +56,13 @@
})

staging::extract { "${name}-${filename}":
source => "${::staging::path}/tomcat/${filename}",
target => $catalina_home,
require => Staging::File[$filename],
unless => "test -f ${catalina_home}/NOTICE",
user => $user,
group => $group,
strip => $_strip,
source => "${::staging::path}/tomcat/${filename}",
target => $catalina_home,
require => Staging::File[$filename],
unless => "test -f ${catalina_home}/NOTICE",
user => $user,
group => $group,
environment => $environment,
strip => $_strip,
}
}