Showing with 2,516 additions and 1 deletion.
  1. +6 −0 .fixtures.yml
  2. +4 −0 .gitattributes
  3. +25 −0 .gitignore
  4. +41 −0 .gitlab-ci.yml
  5. +23 −0 .pdkignore
  6. +23 −0 .project
  7. +117 −0 .rubocop.yml
  8. +40 −0 .sync.yml
  9. +44 −0 .travis.yml
  10. +1 −0 .yardopts
  11. +11 −0 CHANGELOG.md
  12. +90 −0 Gemfile
  13. +67 −1 README.md
  14. +247 −0 REFERENCE.md
  15. +6 −0 Rakefile
  16. +104 −0 lib/puppet/provider/zfs/zfs.rb
  17. +131 −0 lib/puppet/provider/zpool/zpool.rb
  18. +162 −0 lib/puppet/type/zfs.rb
  19. +107 −0 lib/puppet/type/zpool.rb
  20. +66 −0 metadata.json
  21. +29 −0 spec/acceptance/lib/solaris_util.rb
  22. +19 −0 spec/acceptance/nodesets/default.yml
  23. +59 −0 spec/acceptance/tests/zfs/basic_tests_spec.rb
  24. +41 −0 spec/acceptance/tests/zfs/should_be_idempotent_spec.rb
  25. +31 −0 spec/acceptance/tests/zfs/should_create_spec.rb
  26. +36 −0 spec/acceptance/tests/zfs/should_query_spec.rb
  27. +29 −0 spec/acceptance/tests/zfs/should_remove_spec.rb
  28. +179 −0 spec/acceptance/tests/zpool/basic_tests_spec.rb
  29. +31 −0 spec/acceptance/tests/zpool/should_be_idempotent_spec.rb
  30. +30 −0 spec/acceptance/tests/zpool/should_create_spec.rb
  31. +36 −0 spec/acceptance/tests/zpool/should_query_spec.rb
  32. +35 −0 spec/acceptance/tests/zpool/should_remove_spec.rb
  33. +8 −0 spec/default_facts.yml
  34. +2 −0 spec/fixtures/unit/provider/zfs/zfs/zfs-list.out
  35. +2 −0 spec/fixtures/unit/provider/zpool/zpool/zpool-list.out
  36. +39 −0 spec/spec_helper.rb
  37. +25 −0 spec/spec_helper_acceptance.rb
  38. +165 −0 spec/unit/provider/zfs/zfs_spec.rb
  39. +255 −0 spec/unit/provider/zpool/zpool_spec.rb
  40. +43 −0 spec/unit/type/zfs_spec.rb
  41. +107 −0 spec/unit/type/zpool_spec.rb
6 changes: 6 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file can be used to install module depdencies for unit testing
# See https://github.com/puppetlabs/puppetlabs_spec_helper#using-fixtures for details
---
fixtures:
forge_modules:
# stdlib: "puppetlabs/stdlib"
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.rb eol=lf
*.erb eol=lf
*.pp eol=lf
*.sh eol=lf
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.*.sw[op]
.metadata
.yardoc
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/Gemfile.lock
/junit/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.rspec
appveyor.yml
41 changes: 41 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
stages:
- syntax
- unit

cache:
paths:
- vendor/bundle

before_script:
- bundle -v
- rm Gemfile.lock || true
- gem update --system
- gem --version
- bundle -v
- bundle install --without system_tests --path vendor/bundle --jobs $(nproc)

parallel_spec-Ruby 2.1.9-Puppet ~> 4.0:
stage: syntax
image: ruby:2.1.9
script:
- bundle exec rake parallel_spec
variables:
PUPPET_GEM_VERSION: '~> 4.0'

syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.4.4-Puppet ~> 5.5:
stage: syntax
image: ruby:2.4.4
script:
- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
variables:
PUPPET_GEM_VERSION: '~> 5.5'

parallel_spec-Ruby 2.4.4-Puppet ~> 5.5:
stage: syntax
image: ruby:2.4.4
script:
- bundle exec rake parallel_spec
variables:
PUPPET_GEM_VERSION: '~> 5.5'

23 changes: 23 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.*.sw[op]
.metadata
.yardoc
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/Gemfile.lock
/junit/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
.DS_Store
23 changes: 23 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>puppetlabs-zfs_core</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.puppetlabs.geppetto.pp.dsl.ui.modulefileBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.puppetlabs.geppetto.pp.dsl.ui.puppetNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>
117 changes: 117 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
require: rubocop-rspec
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.1'
Include:
- "./**/*.rb"
Exclude:
- bin/*
- ".vendor/**/*"
- "**/Gemfile"
- "**/Rakefile"
- pkg/**/*
- spec/fixtures/**/*
- vendor/**/*
- "**/Puppetfile"
- "**/Vagrantfile"
- "**/Guardfile"
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Exclude:
- spec/acceptance/**/*.rb
RSpec/HookArgument:
Description: Prefer explicit :each argument, matching existing module's style
EnforcedStyle: each
Style/BlockDelimiters:
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
be consistent then.
EnforcedStyle: braces_for_chaining
Style/ClassAndModuleChildren:
Description: Compact style reduces the required amount of indentation.
EnforcedStyle: compact
Style/EmptyElse:
Description: Enforce against empty else clauses, but allow `nil` for clarity.
EnforcedStyle: empty
Style/FormatString:
Description: Following the main puppet project's style, prefer the % format format.
EnforcedStyle: percent
Style/FormatStringToken:
Description: Following the main puppet project's style, prefer the simpler template
tokens over annotated ones.
EnforcedStyle: template
Style/Lambda:
Description: Prefer the keyword for easier discoverability.
EnforcedStyle: literal
Style/RegexpLiteral:
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
EnforcedStyle: percent_r
Style/TernaryParentheses:
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
on complex expressions for better readability, but seriously consider breaking
it up.
EnforcedStyle: require_parentheses_when_complex
Style/TrailingCommaInArguments:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/TrailingCommaInLiteral:
Description: Prefer always trailing comma on multiline literals. This makes diffs,
and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/SymbolArray:
Description: Using percent style obscures symbolic intent of array's contents.
EnforcedStyle: brackets
RSpec/InstanceVariable:
Enabled: false
RSpec/MessageSpies:
EnforcedStyle: receive
Style/Documentation:
Exclude:
- lib/puppet/parser/functions/**/*
Style/WordArray:
EnforcedStyle: brackets
Style/CollectionMethods:
Enabled: true
Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/StringMethods:
Enabled: true
Layout/EndOfLine:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/ParameterLists:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
RSpec/DescribeClass:
Enabled: false
RSpec/ExampleLength:
Enabled: false
RSpec/MessageExpectation:
Enabled: false
RSpec/MultipleExpectations:
Enabled: false
RSpec/NestedGroups:
Enabled: false
Style/AsciiComments:
Enabled: false
Style/IfUnlessModifier:
Enabled: false
Style/SymbolProc:
Enabled: false
40 changes: 40 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
Gemfile:
required:
':system_tests':
- gem: 'puppet-module-posix-system-r#{minor_version}'
platforms: ruby
- gem: 'puppet-module-win-system-r#{minor_version}'
platforms:
- mswin
- mingw
- x64_mingw
- gem: beaker
version: '~> 3.34'
from_env: BEAKER_VERSION
- gem: beaker-abs
from_env: BEAKER_ABS_VERSION
version: '~> 0.5'
- gem: beaker-pe
- gem: beaker-hostgenerator
from_env: BEAKER_HOSTGENERATOR_VERSION
- gem: beaker-rspec
from_env: BEAKER_RSPEC_VERSION
- gem: beaker-puppet
from_env: BEAKER_PUPPET_VERSION
version: '~> 0.15'
':development':
- gem: puppet-strings

spec/spec_helper.rb:
mock_with: ':rspec'

.rubocop.yml:
default_configs:
RSpec/InstanceVariable:
Enabled: false

.gitignore:
required:
- '.rspec'
- 'appveyor.yml'
44 changes: 44 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
sudo: false
dist: trusty
language: ruby
cache: bundler
before_install:
- bundle -v
- rm -f Gemfile.lock
- gem update --system
- gem --version
- bundle -v
script:
- 'bundle exec rake $CHECK'
bundler_args: --without system_tests
rvm:
- 2.4.1
env:
global:
- BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_GEM_VERSION="~> 5.0"
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: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
rvm: 2.1.9
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"
1 change: 1 addition & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--markup markdown
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

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).

## [1.0.0] - 2018-05-21
### Summary
This is the initial release of the extracted zfs/zpool module

[1.0.0]: https://github.com/puppetlabs/puppetlabs-zfs_core/releases/tag/1.0.0
Loading