Skip to content

Commit

Permalink
Add proxy server support to download files (Windows) (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
ifunky authored and pcfens committed Mar 7, 2017
1 parent 1407b09 commit 38ffce2
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@
# @param processors [Hash] Processors that will be added. Commonly used to create processors using hiera.
# @param prospectors [Hash] Prospectors that will be created. Commonly used to create prospectors using hiera
# @param prospectors_merge [Boolean] Whether $prospectors should merge all hiera sources, or use simple automatic parameter lookup
# proxy_address [String] Proxy server to use for downloading files
class filebeat (
$major_version = undef,
$package_ensure = $filebeat::params::package_ensure,
@@ -83,6 +84,7 @@
#### End v5 onlly ####
$prospectors = {},
$prospectors_merge = false,
$proxy_address = undef
) inherits filebeat::params {

include ::stdlib
@@ -141,6 +143,10 @@
fail('Filebeat versions 1.0.0-rc1 and before are unsupported because they don\'t parse normal YAML headers')
}

if(!empty($proxy_address)){
validate_re($proxy_address, ['^(http(?:s)?\:\/\/[a-zA-Z0-9]+(?:(?:\.|\-)[a-zA-Z0-9]+)+(?:\:\d+)?(?:\/[\w\-]+)*(?:\/?|\/\w+\.[a-zA-Z]{2,4}(?:\?[\w]+\=[\w\-]+)?)?(?:\&[\w]+\=[\w\-]+)*)$'], 'ERROR: You must enter a proxy url in a valid format i.e. http://proxy.net:3128')
}

anchor { 'filebeat::begin': } ->
class { '::filebeat::install': } ->
class { '::filebeat::config': } ->
1 change: 1 addition & 0 deletions manifests/install/windows.pp
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
ensure => present,
source => $filebeat::download_url,
verify_peer => false,
proxy => $filebeat::proxy_address,
}

exec { "unzip ${filename}":

0 comments on commit 38ffce2

Please sign in to comment.