Showing with 101 additions and 47 deletions.
  1. +0 −4 .fixtures.yml
  2. +60 −15 .github/CONTRIBUTING.md
  3. +1 −1 .msync.yml
  4. +4 −4 .travis.yml
  5. +12 −0 CHANGELOG.md
  6. +2 −3 Gemfile
  7. +8 −2 lib/puppet/provider/windowsfeature/default.rb
  8. +0 −1 lib/puppet/type/windowsfeature.rb
  9. +5 −3 metadata.json
  10. +0 −4 spec/classes/coverage_spec.rb
  11. +0 −1 spec/default_facts.yml
  12. +9 −9 spec/spec_helper.rb
4 changes: 0 additions & 4 deletions .fixtures.yml

This file was deleted.

75 changes: 60 additions & 15 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ By participating in this project you agree to abide by its terms.

1. Create a separate branch for your change.

1. Run the tests. We only take pull requests with passing tests, and
documentation.
1. We only take pull requests with passing tests, and documentation. [travis-ci](http://travis-ci.org)
runs the tests for us. You can also execute them locally. This is explained
in a later section.

1. Checkout [our docs](https://voxpupuli.org/docs/#reviewing-a-module-pr) we
use to review a module and the [official styleguide](https://puppet.com/docs/puppet/6.0/style_guide.html).
They provide some guidance for new code that might help you before you submit a pull request.

1. Add a test for your change. Only refactoring and documentation
changes require no new tests. If you are adding functionality
or fixing a bug, please add a test.

1. Squash your commits down into logical components. Make sure to rebase
against the current master.
against our current master.

1. Push the branch to your fork and submit a pull request.

Expand All @@ -38,7 +43,9 @@ By default the tests use a baseline version of Puppet.
If you have Ruby 2.x or want a specific version of Puppet,
you must set an environment variable such as:

export PUPPET_VERSION="~> 4.2.0"
```sh
export PUPPET_VERSION="~> 5.5.6"
```

You can install all needed gems for spec tests into the modules directory by
running:
Expand All @@ -65,13 +72,17 @@ The test suite will run [Puppet Lint](http://puppet-lint.com/) and
[Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to
check various syntax and style things. You can run these locally with:

bundle exec rake lint
bundle exec rake validate
```sh
bundle exec rake lint
bundle exec rake validate
```

It will also run some [Rubocop](http://batsov.com/rubocop/) tests
against it. You can run those locally ahead of time with:

bundle exec rake rubocop
```sh
bundle exec rake rubocop
```

## Running the unit tests

Expand All @@ -82,15 +93,21 @@ about how best to test your new feature.

To run the linter, the syntax checker and the unit tests:

bundle exec rake test
```sh
bundle exec rake test
```

To run your all the unit tests

bundle exec rake spec SPEC_OPTS='--format documentation'
```sh
bundle exec rake spec
```

To run a specific spec test set the `SPEC` variable:

bundle exec rake spec SPEC=spec/foo_spec.rb
```sh
bundle exec rake spec SPEC=spec/foo_spec.rb
```

## Integration tests

Expand All @@ -102,23 +119,51 @@ This fires up a new virtual machine (using vagrant) and runs a series of
simple tests against it after applying the module. You can run this
with:

bundle exec rake acceptance
```sh
bundle exec rake acceptance
```

This will run the tests on the module's default nodeset. You can override the
nodeset used, e.g.,

BEAKER_set=centos-7-x64 bundle exec rake acceptance
```sh
BEAKER_set=centos-7-x64 bundle exec rake acceptance
```

There are default rake tasks for the various acceptance test modules, e.g.,

bundle exec rake beaker:centos-7-x64
bundle exec rake beaker:ssh:centos-7-x64
```sh
bundle exec rake beaker:centos-7-x64
bundle exec rake beaker:ssh:centos-7-x64
```

If you don't want to have to recreate the virtual machine every time you can
use `BEAKER_destroy=no` and `BEAKER_provision=no`. On the first run you will at
least need `BEAKER_provision` set to yes (the default). The Vagrantfile for the
created virtual machines will be in `.vagrant/beaker_vagrant_files`.

Beaker also supports docker containers. We also use that in our automated CI
pipeline at [travis-ci](http://travis-ci.org). To use that instead of Vagrant:

```
PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} BEAKER_destroy=yes bundle exec rake beaker
```

You can replace the string `debian9` with any common operating system.
The following strings are known to work:

* ubuntu1604
* ubuntu1804
* debian8
* debian9
* centos6
* centos7

The easiest way to debug in a docker container is to open a shell:

docker exec -it -u root ${container_id_or_name} bash
```sh
docker exec -it -u root ${container_id_or_name} bash
```

The source of this file is in our [modulesync_config](https://github.com/voxpupuli/modulesync_config/blob/master/moduleroot/.github/CONTRIBUTING.md.erb)
repository.
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '2.0.0'
modulesync_config_version: '2.2.0'
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ matrix:
env: PUPPET_VERSION="~> 5.0" CHECK=test
- rvm: 2.5.1
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
env: PUPPET_VERSION="~> 6.0" CHECK=test_with_coveralls
- rvm: 2.5.1
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 6.0" CHECK=rubocop
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
branches:
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ 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.2.2](https://github.com/voxpupuli/puppet-windowsfeature/tree/v3.2.2) (2018-10-19)

[Full Changelog](https://github.com/voxpupuli/puppet-windowsfeature/compare/v3.2.1...v3.2.2)

**Fixed bugs:**

- Targeted Deprecation Notice of Restart parameter \(\#120\) [\#122](https://github.com/voxpupuli/puppet-windowsfeature/pull/122) ([fiveshotsofespresso](https://github.com/fiveshotsofespresso))

**Closed issues:**

- The restart parameter has been deprecated in favor of the puppetlabs reboot module \( https://github.com/puppetlabs/puppetlabs-reboot \). This parameter will be removed in the next release. \(location: C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet/type/windowsfeature.rb:20:in `block \(2 levels\) in \<top \(required\)\>'\) shows every run [\#120](https://github.com/voxpupuli/puppet-windowsfeature/issues/120)

## [v3.2.1](https://github.com/voxpupuli/puppet-windowsfeature/tree/v3.2.1) (2018-09-07)

[Full Changelog](https://github.com/voxpupuli/puppet-windowsfeature/compare/v3.2.0...v3.2.1)
Expand Down
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'puppetlabs_spec_helper', '~> 2.6', :require => false
gem 'rspec-puppet', '~> 2.5', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'puppetlabs_spec_helper', '>= 2.11.0', :require => false
gem 'rspec-puppet-facts', '>= 1.8.0', :require => false
gem 'rspec-puppet-utils', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
Expand Down
10 changes: 8 additions & 2 deletions lib/puppet/provider/windowsfeature/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ def create
array << "Import-Module ServerManager; Install-WindowsFeature #{resource[:name]}" if win2008 == false
# add restart, subfeatures and a source optionally
array << '-IncludeAllSubFeature' if @resource[:installsubfeatures] == true
array << '-Restart' if @resource[:restart] == true
if @resource[:restart] == true
Puppet.deprecation_warning('The restart parameter has been deprecated in favor of the puppetlabs reboot module ( https://github.com/puppetlabs/puppetlabs-reboot ). This parameter will be removed in the next release.')
array << '-Restart'
end
array << "-Source #{resource[:source]}" unless @resource[:source].to_s.strip.empty?
# raise an error if 2008 tried to install mgmt tools
if @resource[:installmanagementtools] == true && win2008 == true
Expand All @@ -89,7 +92,10 @@ def destroy
array << "Import-Module ServerManager; Remove-WindowsFeature #{resource[:name]}" if win2008 == true
array << "Import-Module ServerManager; Uninstall-WindowsFeature #{resource[:name]}" if win2008 == false
# add the restart flag optionally
array << '-Restart' if @resource[:restart] == true
if @resource[:restart] == true
Puppet.deprecation_warning('The restart parameter has been deprecated in favor of the puppetlabs reboot module ( https://github.com/puppetlabs/puppetlabs-reboot ). This parameter will be removed in the next release.')
array << '-Restart'
end
# show the created ps string, get the result, show the result (debug)
Puppet.debug "Powershell destroy command is '#{array}'"
result = ps(array.join(' '))
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/type/windowsfeature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
end

newparam(:restart, boolean: true, parent: Puppet::Parameter::Boolean) do
Puppet.deprecation_warning('The restart parameter has been deprecated in favor of the puppetlabs reboot module ( https://github.com/puppetlabs/puppetlabs-reboot ). This parameter will be removed in the next release.')
end

newparam(:source) do
Expand Down
8 changes: 5 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-windowsfeature",
"version": "3.2.1",
"version": "3.2.2",
"author": "Vox Pupuli",
"license": "MIT",
"summary": "A module that will turn windows features on or off for Windows Server 2008 and above",
Expand All @@ -23,11 +23,13 @@
]
}
],
"dependencies": [],
"dependencies": [

],
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.10.0 < 6.0.0"
"version_requirement": ">= 4.10.0 < 7.0.0"
}
]
}
4 changes: 0 additions & 4 deletions spec/classes/coverage_spec.rb

This file was deleted.

1 change: 0 additions & 1 deletion spec/default_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# Hint if using with rspec-puppet-facts ("on_supported_os.each"):
# if a same named fact exists in facterdb it will be overridden.
---
concat_basedir: "/tmp"
ipaddress: "172.16.254.254"
is_pe: false
macaddress: "AA:AA:AA:AA:AA:AA"
18 changes: 9 additions & 9 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
include RspecPuppetFacts

# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
include RspecPuppetFacts

if Dir.exist?(File.expand_path('../../lib', __FILE__))
require 'coveralls'
Expand All @@ -23,14 +22,15 @@
end

RSpec.configure do |c|
default_facts = {
puppetversion: Puppet.version,
facterversion: Facter.version
}
default_facts = {}
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_facts.yml', __FILE__))
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_module_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_module_facts.yml', __FILE__))
c.default_facts = default_facts

# Coverage generation
c.after(:suite) do
RSpec::Puppet::Coverage.report!
end
end

require 'spec_helper_methods'
# vim: syntax=ruby