3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
5 changes: 5 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/appveyor.yml
/.fixtures.yml
/Gemfile
Expand All @@ -30,8 +33,10 @@
/.gitlab-ci.yml
/.pdkignore
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.travis.yml
/.yardopts
/spec/
/.vscode/
1 change: 1 addition & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--relative
15 changes: 13 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
require: rubocop-rspec
require:
- rubocop-rspec
- rubocop-i18n
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.1'
Expand All @@ -19,10 +21,13 @@ AllCops:
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
GetText:
Enabled: false
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/*
- spec/**/*
Enabled: false
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Expand Down Expand Up @@ -103,6 +108,12 @@ Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/StringMethods:
Enabled: true
GetText/DecorateFunctionMessage:
Enabled: false
GetText/DecorateStringFormattingUsingInterpolation:
Enabled: false
GetText/DecorateStringFormattingUsingPercent:
Enabled: false
Layout/EndOfLine:
Enabled: false
Metrics/AbcSize:
Expand Down
9 changes: 9 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
RSpec/ExpectInHook:
Exclude: ['spec/integration/provider/mount_spec.rb']
Gemfile:
optional:
':development':
- gem: 'github_changelog_generator'
git: 'https://github.com/skywinder/github-changelog-generator'
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
required:
':system_tests':
- gem: 'puppet-module-posix-system-r#{minor_version}'
Expand Down Expand Up @@ -50,3 +56,6 @@ appveyor.yml:
remove_includes:
- env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
rvm: 2.1.9

Rakefile:
changelog_version_tag_pattern: '%s'
42 changes: 19 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
---
dist: trusty
dist: xenial
language: ruby
cache: bundler
before_install:
- if [ $BUNDLER_VERSION ]; then
gem install -v $BUNDLER_VERSION bundler --no-rdoc --no-ri;
fi
- bundle -v
- rm -f Gemfile.lock
- gem update --system $RUBYGEMS_VERSION
Expand All @@ -15,35 +12,34 @@ script:
- 'bundle exec rake $CHECK'
bundler_args: --without system_tests
rvm:
- 2.5.1
env:
global:
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0"
- 2.5.3
stages:
- static
- spec
- acceptance
-
if: tag =~ ^v\d
name: deploy
matrix:
fast_finish: true
include:
-
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
-
env: CHECK=parallel_spec
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
stage: static
-
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
rvm: 2.4.4
rvm: 2.4.5
stage: spec
-
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
rvm: 2.5.3
stage: spec
-
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec RUBYGEMS_VERSION=2.7.8 BUNDLER_VERSION=1.17.3
rvm: 2.1.9
env: DEPLOY_TO_FORGE=yes
stage: deploy
branches:
only:
- master
- /^v\d/
notifications:
email: false
deploy:
provider: puppetforge
user: puppet
password:
secure: ""
on:
tags: true
all_branches: true
condition: "$DEPLOY_TO_FORGE = yes"
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"jpogran.puppet-vscode",
"rebornix.Ruby"
]
}
63 changes: 41 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,50 @@
# Changelog
# Change log

All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
## [1.0.4](https://github.com/puppetlabs/puppetlabs-mount_core/tree/1.0.4) (2019-10-31)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-mount_core/compare/1.0.3...1.0.4)

## [1.0.3] - 2019-01-17
### Added
- (PUP-9307) Allow for trailing slashes in mount resource title
### Changed
- (maint) Update PDK to 1.8.0
Localization improvements and updated translations
Added LICENSE file

## [1.0.2] - 2018-08-20
- pdksync - \(maint\) Update module using PDK 1.14.0 [\#20](https://github.com/puppetlabs/puppetlabs-mount_core/pull/20) ([mihaibuzgau](https://github.com/mihaibuzgau))
- \(MODULES-8304\) Allow whitespace in mountpoints on Linux [\#19](https://github.com/puppetlabs/puppetlabs-mount_core/pull/19) ([GabrielNagy](https://github.com/GabrielNagy))

### Fixed

- \(maint\) Fix broken contributing URL [\#18](https://github.com/puppetlabs/puppetlabs-mount_core/pull/18) ([GabrielNagy](https://github.com/GabrielNagy))

## [1.0.3](https://github.com/puppetlabs/puppetlabs-mount_core/tree/1.0.3) (2019-01-18)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-mount_core/compare/1.0.2...1.0.3)

### Added
- (PUP-9053) Enable localization
### Changed
- (PUP-9052) Bump puppet req to at least puppet 6

## [1.0.1] - 2018-07-26
### Summary
Use require_relative to load provider helper code.
- aph/pup-9307-mount-trailing-slashes [\#13](https://github.com/puppetlabs/puppetlabs-mount_core/pull/13) ([m0dular](https://github.com/m0dular))
- \(maint\) update PDK to 1.8.0; update all templates [\#12](https://github.com/puppetlabs/puppetlabs-mount_core/pull/12) ([melissa](https://github.com/melissa))
- \(L10n\) Updating translations for readmes/README\_ja\_JP.md [\#10](https://github.com/puppetlabs/puppetlabs-mount_core/pull/10) ([ehom](https://github.com/ehom))

## [1.0.2](https://github.com/puppetlabs/puppetlabs-mount_core/tree/1.0.2) (2018-08-20)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-mount_core/compare/1.0.1...1.0.2)

## [1.0.1](https://github.com/puppetlabs/puppetlabs-mount_core/tree/1.0.1) (2018-07-26)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-mount_core/compare/1.0.0...1.0.1)

### Added

- Use relative\_require to load helper code [\#3](https://github.com/puppetlabs/puppetlabs-mount_core/pull/3) ([joshcooper](https://github.com/joshcooper))

## [1.0.0](https://github.com/puppetlabs/puppetlabs-mount_core/tree/1.0.0) (2018-07-18)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-mount_core/compare/bb9ea3bf32a116c95339a1e399eda22d76554f30...1.0.0)

### Added

- Initial mount module extraction [\#1](https://github.com/puppetlabs/puppetlabs-mount_core/pull/1) ([joshcooper](https://github.com/joshcooper))


## [1.0.0] - 2018-07-18
### Summary
This is the initial release of the extracted mount module.

[1.0.2]: https://github.com/puppetlabs/puppetlabs-mount_core/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/puppetlabs/puppetlabs-mount_core/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/puppetlabs/puppetlabs-mount_core/releases/tag/1.0.0
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @puppetlabs/night-s-watch
24 changes: 13 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-strings", require: false
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-strings", require: false
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ Puppet Labs modules on the Puppet Forge are open projects, and community contrib

We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

For more information, see our [module contribution guide.](https://docs.puppetlabs.com/forge/contributing.html)
For more information, see our [module contribution guide](https://puppet.com/docs/puppet/latest/contributing.html).
11 changes: 6 additions & 5 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ mount/unmount status.

##### `device`

The device providing the mount. This can be whatever
device is supporting by the mount, including network
devices or devices specified by UUID rather than device
path, depending on the operating system.
The device providing the mount. This can be whatever device
is supporting by the mount, including network devices or
devices specified by UUID rather than device path, depending
on the operating system. On Linux systems it can contain
whitespace.

##### `blockdevice`

Expand Down Expand Up @@ -100,7 +101,7 @@ The following parameters are available in the `mount` type.

namevar

The mount path for the mount.
The mount path for the mount. On Linux systems it can contain whitespace.

##### `remounts`

Expand Down
16 changes: 13 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
Expand All @@ -14,15 +15,24 @@ end

def changelog_project
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = nil || JSON.load(File.read('metadata.json'))['name']
raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil?

returnVal = nil
returnVal ||= begin
metadata_source = JSON.load(File.read('metadata.json'))['source']
metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})

metadata_source_match && metadata_source_match[1]
end

raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?

puts "GitHubChangelogGenerator project:#{returnVal}"
returnVal
end

def changelog_future_release
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = JSON.load(File.read('metadata.json'))['version']
returnVal = "%s" % JSON.load(File.read('metadata.json'))['version']
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator future_release:#{returnVal}"
returnVal
Expand Down
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
21 changes: 21 additions & 0 deletions hiera.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
version: 5

defaults: # Used for any hierarchy level that omits these keys.
datadir: data # This path is relative to hiera.yaml's directory.
data_hash: yaml_data # Use the built-in YAML backend.

hierarchy:
- name: "osfamily/major release"
paths:
- "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
# Used for Solaris
- "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
# Used to distinguish between Debian and Ubuntu
- "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
- name: "osfamily"
paths:
- "os/%{facts.os.family}.yaml"
- "os/%{facts.os.name}.yaml"
- name: 'common'
path: 'common.yaml'
2 changes: 1 addition & 1 deletion lib/puppet/provider/mount.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def using_explicit_options?

# This only works when the mount point is synced to the fstab.
def unmount
umount(resource[:name])
umount resource[:name]

# Update property hash for future queries (e.g. refresh is called)
case get(:ensure)
Expand Down
Loading