download_file
Version information
This version is compatible with:
- Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x
- Puppet >= 5.5.8 < 7.0.0
This module has been deprecated by its author since Nov 19th 2024.
The reason given was: This module has now been deprecated in favor of the puppet-archive
The author has suggested puppet-archive as its replacement.
Start using this module
Documentation
Download File module for Puppet
Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with download_file
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Overview
The download_file module allows you to download files on Windows
Module Description
The download_file module introduced a small define download_file
that will
allow you to download a file over http(s) for usage during an installation.
This was created because the package resource does not support http as a source
for packages. It is only supported on Windows.
Setup
What download_file affects
- Downloads files onto each node
Setup Requirements
- download_file makes use of Powershell so you will need to have at least version 2.0 installed in order to use this module.
Beginning with download_file
To download dotnet 4.0
download_file { "Download dotnet 4.0" :
url => 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe',
destination_directory => 'c:\temp'
}
To download dotnet 4.0 using a proxy
download_file { "Download dotnet 4.0" :
url => 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe',
destination_directory => 'c:\temp',
proxy_address => 'http://corporateproxy.net:8080'
}
The proxy will be used as part of the download using PowerShell. This does not set a system wide proxy
Usage
Reference
Defined Types
Public Types
download_file
: Download a give file
Parameters
url
The http(s) destination of the file that you are looking to download
destination_directory
The full path to the directory on the system where the file will be downloaded to
destination_file
The optional name of the file to download onto the system.
user
The optional userid is used when authenticating via Basic Auth with the server.
user
and password
must be specified or this has no effect.
password
The optional password is used when authenticating via Basic Auth with the server.
user
and password
must be specified or this has no effect.
proxy_address
The optional http proxy address to use when downloading the file
proxy_user
The optional http proxy user to use when downloading the file. proxy_address
and proxy_password
must be specified or this has no effect.
proxy_password
The optional http proxy password to use when downloading the file. proxy_address
and proxy_user
must be specified or this has no effect. By default this value
accepts secure strings. A secure string is (unfortunately) tied to the machine
that it is used for. To generate a secure string for a given machine, users
should run the following powershell command on that machine (replacing
PASSWORD with the desired password):
ConvertFrom-SecureString -securestring $(ConvertTo-SecureString "PASSWORD" -AsPlainText -Force)
It is possible to get this information then clear the command from history, but it's important to note that the -Force argument is there to suppress warnings that the plaintext password is in the history.
If this process sounds unappealing, you can send the password in plaintext
(which sits in the download-<filename>.ps1
file on the machine being provisioned)
by changing the is_password_secure
variable to false
.
is_password_secure
The optional switch to change the way that proxyPassword
is interpreted from
secure string to plaintext. This will send the password in plaintext to the
machine being provisioned, which may be a security concern.
cookies
An optional array of cookies to add to the HTTP request for the download.
Limitations
This module is tested on the following platforms:
- Windows 2008
- Windows 2008 R2
- Windows 2012
- Windows 2012 R2
- Windows 7
- Windows 8
It is tested with the OSS version of Puppet only.
Contributing
Please read CONTRIBUTING.md for full details on contributing to this project.
Changelog
All notable changes to this project will be documented in this file. Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module.
v4.0.0 (2020-04-07)
Breaking changes:
- modulesync 2.7.0 and drop puppet 4 #88 (bastelfreak)
Implemented enhancements:
- Allow enabled SSL protocols to be specified #86 (aadamovich)
Closed issues:
Merged pull requests:
- Allow puppetlabs/stdlib 6.x #97 (dhoppe)
- Remove duplicate CONTRIBUTING.md file #93 (dhoppe)
- Remove spurious space from operatingsystem #89 (ekohl)
v3.2.0 (2018-10-14)
Implemented enhancements:
- No authentication #9
- Adding basic auth capability to downloadfile #75 (scottpecnik)
Merged pull requests:
- modulesync 2.1.0 and allow puppet 6.x #83 (bastelfreak)
- allow puppetlabs/stdlib 5.x #80 (bastelfreak)
- Remove docker nodesets #76 (bastelfreak)
v3.1.0 (2018-03-30)
Implemented enhancements:
- Optional parameter user_agent #65 (ofalk)
- Fix error duplicate resource when url has same ending #63 (devcfgc)
Merged pull requests:
- bump puppet to latest supported version 4.10.0 #70 (bastelfreak)
v3.0.0 (2017-10-19)
Breaking changes:
- Replace validate_* calls with datatypes #58 (bastelfreak)
Merged pull requests:
- Release 3.0.0 #61 (bastelfreak)
- Add cookie support #54 (spacepants)
- modulesync 0.19.3 #51 (bastelfreak)
v2.1.0 (2017-02-11)
This is the last release with puppet3 support!
- Fix several markdown issues
- Add missing badges
- Rubocop: Fix RSpec/ImplicitExpect
- Set min version_requirement for Puppet + deps
2016-08-19 - Release 2.0.0
- Modulesync with latest Vox Pupuli defaults
- Add fields for proxy credentials
- Fix powershell file generation
- deprecate proxyAddress and change the new parameters to snake case
- Drop of ruby1.8.7 Support
##2016-01-18 - Release 1.3.0 ###Summary
This release fixes the default timeout value for exec and also deprecates the proxyAddress variable in favor of proxy_address
##2015-04-17 - Release 1.2.1 ###Summary
This release contains various changes needed after the move to the puppet-community namespace
##2014-10-17 - Release 1.1.1 ###Summary
This releases fixes a bug where duplicate resources can occur
####Bugfixes
- fixes (#10) where C:\Temp and C:/Temp throws duplicate resource error
##2014-10-17 - Release 1.1.0 ###Summary
This release adds support to provide the file location
####Features
- Adds new parameter
destination_file
to provide the name of the file to download onto the system.
##2014-10-10 - Release 1.0.0 ###Summary
This release has some bug fixes but is mostly improving the documentation and testing to bring it up to a higher quality standard.
####Bug Fixes
- adding condition to check if C:\temp has already been defined
##2014-02-24 - Release 0.0.2 ###Summary
Minor update to include improved documentation of the proxy parameters
##2013-11-29 - Release 0.0.1 ###Summary
Initial public release of the module
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 4.13.1 < 7.0.0)
- puppetlabs/powershell (>= 1.1.1 < 3.0.0)
Copyright (c) 2014 OpenTable, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.