12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@ Thank you for contributing to this project!
- Our vulnerabilities reporting process is at https://voxpupuli.org/security/
-->
#### Pull Request (PR) description
<!--
Replace this comment with a description of your pull request.
-->

#### This Pull Request (PR) fixes the following issues
<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '1.3.0'
modulesync_config_version: '1.9.0'
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ Style/HashSyntax:
Style/RedundantReturn:
Enabled: True

Layout/EndOfLine:
Enabled: False

Lint/AmbiguousOperator:
Enabled: True

Expand Down
31 changes: 17 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,38 @@ dist: trusty
language: ruby
cache: bundler
before_install:
- bundle -v
- rm Gemfile.lock || true
- gem update --system
- gem update bundler
- gem --version
- bundle -v
- rm -f Gemfile.lock
script:
- 'bundle exec rake $CHECK'
matrix:
fast_finish: true
include:
- rvm: 2.1.9
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.4.2
bundler_args: --without system_tests development
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.2
bundler_args: --without system_tests development
- rvm: 2.5.0
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
- rvm: 2.4.2
bundler_args: --without system_tests development
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
branches:
only:
- master
- /^v\d/
notifications:
email: false
irc:
on_success: always
on_failure: always
channels:
- "chat.freenode.org#voxpupuli-notifications"
deploy:
provider: puppetforge
user: puppet
Expand Down
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@ 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.

## [v3.0.0](https://github.com/voxpupuli/puppet-download_file/tree/v3.0.0) (2017-10-20)
## [v3.1.0](https://github.com/voxpupuli/puppet-download_file/tree/v3.1.0) (2018-03-30)

[Full Changelog](https://github.com/voxpupuli/puppet-download_file/compare/v3.0.0...v3.1.0)

**Implemented enhancements:**

- Optional parameter user\_agent [\#65](https://github.com/voxpupuli/puppet-download_file/pull/65) ([ofalk](https://github.com/ofalk))
- Fix error duplicate resource when url has same ending [\#63](https://github.com/voxpupuli/puppet-download_file/pull/63) ([devcfgc](https://github.com/devcfgc))

**Merged pull requests:**

- bump puppet to latest supported version 4.10.0 [\#70](https://github.com/voxpupuli/puppet-download_file/pull/70) ([bastelfreak](https://github.com/bastelfreak))

## [v3.0.0](https://github.com/voxpupuli/puppet-download_file/tree/v3.0.0) (2017-10-19)

[Full Changelog](https://github.com/voxpupuli/puppet-download_file/compare/v2.1.0...v3.0.0)

Expand All @@ -14,6 +27,7 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- Release 3.0.0 [\#61](https://github.com/voxpupuli/puppet-download_file/pull/61) ([bastelfreak](https://github.com/bastelfreak))
- Add cookie support [\#54](https://github.com/voxpupuli/puppet-download_file/pull/54) ([spacepants](https://github.com/spacepants))
- modulesync 0.19.3 [\#51](https://github.com/voxpupuli/puppet-download_file/pull/51) ([bastelfreak](https://github.com/bastelfreak))

Expand Down Expand Up @@ -93,4 +107,4 @@ Minor update to include improved documentation of the proxy parameters
Initial public release of the module


\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'puppetlabs_spec_helper', '~> 2.4.0', :require => false
gem 'puppetlabs_spec_helper', '~> 2.6.0', :require => false
gem 'rspec-puppet', '~> 2.5', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rspec-puppet-utils', :require => false
Expand Down Expand Up @@ -43,6 +43,8 @@ group :system_tests do
gem 'winrm', :require => false
if beaker_version = ENV['BEAKER_VERSION']
gem 'beaker', *location_for(beaker_version)
else
gem 'beaker', '>= 3.9.0', :require => false
end
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
gem 'beaker-rspec', *location_for(beaker_rspec_version)
Expand All @@ -55,7 +57,7 @@ group :system_tests do
end

group :release do
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/skywinder/github-changelog-generator' if RUBY_VERSION >= '2.2.2'
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '~> 1.0', :require => false
Expand Down
39 changes: 36 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet_blacksmith/rake_tasks'
require 'voxpupuli/release/rake_tasks'
require 'puppet-strings/tasks'

# load optional tasks for releases
# only available if gem group releases is installed
begin
require 'puppet_blacksmith/rake_tasks'
require 'voxpupuli/release/rake_tasks'
require 'puppet-strings/tasks'
rescue LoadError
end

PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
PuppetLint.configuration.fail_on_warnings = true
Expand All @@ -20,6 +26,12 @@ exclude_paths = %w(
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths

desc 'Auto-correct puppet-lint offenses'
task 'lint:auto_correct' do
PuppetLint.configuration.fix = true
Rake::Task[:lint].invoke
end

desc 'Run acceptance tests'
RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
Expand All @@ -42,6 +54,27 @@ task test_with_coveralls: [:test] do
end
end

desc "Print supported beaker sets"
task 'beaker_sets', [:directory] do |t, args|
directory = args[:directory]

metadata = JSON.load(File.read('metadata.json'))

(metadata['operatingsystem_support'] || []).each do |os|
(os['operatingsystemrelease'] || []).each do |release|
if directory
beaker_set = "#{directory}/#{os['operatingsystem'].downcase}-#{release}"
else
beaker_set = "#{os['operatingsystem'].downcase}-#{release}-x64"
end

filename = "spec/acceptance/nodesets/#{beaker_set}.yml"

puts beaker_set if File.exists? filename
end
end
end

begin
require 'github_changelog_generator/task'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
Expand Down
12 changes: 8 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
# [*cookies*]
# An optional array of cookies to add to the HTTP request for the download.
#
# [*user_agent*]
# The optional user agent string to be sent when downloading.
#
# === Examples
#
# To download dotnet 4.0
Expand Down Expand Up @@ -67,7 +70,8 @@
$proxy_password = '',
$is_password_secure = true,
Optional[Integer] $timeout = undef,
Optional[Array[String]] $cookies = undef
Optional[Array[String]] $cookies = undef,
Optional[String] $user_agent = undef
) {

if $destination_file {
Expand All @@ -84,16 +88,16 @@
$cookie_string = join($cookies, ';')
}

$powershell_filename = regsubst($url, '^(.*\/)(.+?)(?:\.[^\.]*$|$)$', '\2')
$file_path = "${destination_directory}\\download-${filename}.ps1"

file { "download-${filename}.ps1":
ensure => present,
path => "${destination_directory}\\download-${powershell_filename}.ps1",
path => $file_path,
content => template('download_file/download.ps1.erb'),
}

exec { "download-${filename}":
command => "${destination_directory}\\download-${powershell_filename}.ps1",
command => $file_path,
provider => powershell,
onlyif => "if(Test-Path -Path '${destination_directory}\\${filename}') { exit 1 } else { exit 0 }",
logoutput => true,
Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-download_file",
"version": "3.0.0",
"version": "3.1.0",
"author": "Vox Pupuli",
"license": "MIT",
"summary": "A module that will download files for use on Windows servers. Requires the server to have PowerShell 2.0 and above",
Expand Down Expand Up @@ -36,7 +36,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.7.1 < 6.0.0"
"version_requirement": ">= 4.10.0 < 6.0.0"
}
]
}
1 change: 0 additions & 1 deletion spec/acceptance/nodesets/docker/debian-7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ HOSTS:
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'echo deb http://ftp.debian.org/debian wheezy-backports main >> /etc/apt/sources.list'
- 'apt-get update && apt-get install -y cron locales-all net-tools wget'
CONFIG:
trace_limit: 200
Expand Down
1 change: 0 additions & 1 deletion spec/acceptance/nodesets/docker/debian-8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ HOSTS:
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'echo deb http://ftp.debian.org/debian jessie-backports main >> /etc/apt/sources.list'
- 'apt-get update && apt-get install -y cron locales-all net-tools wget'
- 'rm -f /usr/sbin/policy-rc.d'
- 'systemctl mask getty@tty1.service getty-static.service'
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/nodesets/docker/ubuntu-16.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ HOSTS:
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'systemctl mask getty@tty1.service getty-static.service'
- 'apt-get install -y net-tools wget locales apt-transport-https'
- 'locale-gen en_US.UTF-8'
- 'echo LANG=en_US.UTF-8 > /etc/default/locale'
CONFIG:
trace_limit: 200
masterless: true
Expand Down
2 changes: 0 additions & 2 deletions spec/acceptance/nodesets/fedora-25-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
# platform is fedora 24 because there is no
# puppet-agent for fedora 25 by 2016-12-30
HOSTS:
fedora-25-x64:
roles:
Expand Down
16 changes: 16 additions & 0 deletions spec/acceptance/nodesets/fedora-26-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
HOSTS:
fedora-26-x64:
roles:
- master
platform: fedora-26-x86_64
box: fedora/26-cloud-base
hypervisor: vagrant
CONFIG:
type: aio
...
# vim: syntax=yaml
18 changes: 18 additions & 0 deletions spec/acceptance/nodesets/fedora-27-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
# platform is fedora 26 because there is no puppet-agent
# for fedora 27 as of 2017-11-17
HOSTS:
fedora-27-x64:
roles:
- master
platform: fedora-26-x86_64
box: fedora/27-cloud-base
hypervisor: vagrant
CONFIG:
type: aio
...
# vim: syntax=yaml
Loading