Showing with 2,202 additions and 224 deletions.
  1. +5 −0 .gitattributes
  2. +25 −51 .gitignore
  3. +46 −0 .pdkignore
  4. +1 −0 .puppet-lint.rc
  5. +127 −0 .rubocop.yml
  6. +33 −0 .sync.yml
  7. +2 −35 .travis.yml
  8. +1 −0 .yardopts
  9. +17 −1 CHANGELOG.md
  10. +1 −1 CONTRIBUTING.md
  11. +4 −1 Gemfile
  12. +59 −0 README.md
  13. +158 −2 REFERENCE.md
  14. +1 −0 Rakefile
  15. +25 −0 Vagrantfile
  16. +138 −0 lib/puppet/provider/sensu_etcd_replicator/sensuctl.rb
  17. +132 −0 lib/puppet/provider/sensu_postgres_config/sensuctl.rb
  18. +33 −10 lib/puppet/provider/sensuctl.rb
  19. +1 −1 lib/puppet/type/sensu_api_validator.rb
  20. +107 −0 lib/puppet/type/sensu_etcd_replicator.rb
  21. +52 −0 lib/puppet/type/sensu_postgres_config.rb
  22. +1 −1 lib/puppet/util/sensu_api_validator.rb
  23. +1 −1 manifests/agent.pp
  24. +4 −1 manifests/backend.pp
  25. +6 −40 manifests/backend/datastore/postgresql.pp
  26. +0 −4 manifests/backend/default_resources.pp
  27. +5 −0 manifests/backend/resources.pp
  28. +17 −8 metadata.json
  29. +27 −2 spec/acceptance/00_backend_spec.rb
  30. +18 −0 spec/acceptance/06_postgresql_spec.rb
  31. +164 −0 spec/acceptance/sensu_etcd_replicator_spec.rb
  32. +12 −54 spec/classes/backend_datastore_postgresql_spec.rb
  33. +0 −5 spec/classes/backend_default_resources_spec.rb
  34. +22 −0 spec/classes/backend_resources_spec.rb
  35. +27 −0 spec/fixtures/unit/provider/sensu_etcd_replicator/sensuctl/dump.txt
  36. +8 −0 spec/fixtures/unit/provider/sensu_postgres_config/sensuctl/dump.txt
  37. +27 −0 spec/fixtures/unit/provider/sensuctl/dump.txt
  38. +95 −0 spec/unit/provider/sensu_etcd_replicator/sensuctl_spec.rb
  39. +70 −0 spec/unit/provider/sensu_postgres_config/sensuctl_spec.rb
  40. +9 −0 spec/unit/provider/sensuctl_spec.rb
  41. +203 −0 spec/unit/sensu_etcd_replicator_spec.rb
  42. +175 −0 spec/unit/sensu_postgres_config_spec.rb
  43. +1 −2 tasks/install_agent_linux.json
  44. +1 −2 tasks/install_agent_windows.json
  45. +45 −0 tests/README.md
  46. +1 −0 tests/etcd-ssl/ca-config.json
  47. +27 −0 tests/etcd-ssl/ca-key.pem
  48. +15 −0 tests/etcd-ssl/ca.csr
  49. +18 −0 tests/etcd-ssl/ca.pem
  50. +27 −0 tests/etcd-ssl/client-key.pem
  51. +16 −0 tests/etcd-ssl/client.csr
  52. +20 −0 tests/etcd-ssl/client.pem
  53. +27 −0 tests/etcd-ssl/sensu-backend1-key.pem
  54. +16 −0 tests/etcd-ssl/sensu-backend1.csr
  55. +20 −0 tests/etcd-ssl/sensu-backend1.pem
  56. +27 −0 tests/etcd-ssl/sensu-backend2-key.pem
  57. +16 −0 tests/etcd-ssl/sensu-backend2.csr
  58. +20 −0 tests/etcd-ssl/sensu-backend2.pem
  59. +2 −1 tests/sensu-backend-cluster.pp
  60. +43 −0 tests/sensu-backend-federated-cluster.pp
  61. +1 −1 tests/sensu-backend.pp
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.rb eol=lf
*.erb eol=lf
*.pp eol=lf
*.sh eol=lf
*.epp eol=lf
76 changes: 25 additions & 51 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,57 +1,31 @@
# Default .gitignore for Ruby
*.gem
*.rbc
.bundle
.config
coverage
InstalledFiles
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
/Gemfile.lock
/Gemfile.local

# YARD artifacts
.git/
.*.sw[op]
.metadata
.yardoc
_yardoc
doc/

# Vim
*.swp

# Eclipse
.project

# Visual Studio Code
.vscode/

# OS X
.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

# Puppet
spec/fixtures/manifests/*
spec/fixtures/modules/*

# Vagrant
.vagrant/*

# Sensu
junit/
log/
.project
.envrc
/inventory.yaml
*.log
vendor/
sensu.komodoproject
doc/**

# direnv & rbenv
/.envrc
/.ruby-version

# secrets
tests/sensu_license.json
tests/secrets
tests/secrets.tar
46 changes: 46 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.git/
.*.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
.project
.envrc
/inventory.yaml
/appveyor.yml
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.travis.yml
/.yardopts
/spec/
/.vscode/
*.log
tests/sensu_license.json
tests/secrets
tests/secrets.tar
1 change: 1 addition & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--relative
127 changes: 127 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
require:
- rubocop-rspec
- rubocop-i18n
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
GetText:
Enabled: false
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/**/*
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/MessageSpies:
EnforcedStyle: receive
Style/Documentation:
Exclude:
- lib/puppet/parser/functions/**/*
- spec/**/*
Style/WordArray:
EnforcedStyle: brackets
Style/CollectionMethods:
Enabled: true
Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/StringMethods:
Enabled: true
Layout/EndOfLine:
Enabled: false
Layout/IndentHeredoc:
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
33 changes: 33 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.rubocop.yml:
default_configs:
AllCops:
Exclude:
- '**/*'
.vscode/extensions.json:
delete: true
spec/default_facts.yml:
delete: true
.gitlab-ci.yml:
delete: true
.pdkignore:
paths: &ignorepaths
- '*.log'
- tests/sensu_license.json
- tests/secrets
- tests/secrets.tar
data/common.yaml:
unmanaged: true
Rakefile:
unmanaged: true
.travis.yml:
unmanaged: true
spec/spec_helper.rb:
unmanaged: true
.gitignore:
paths: *ignorepaths
Gemfile:
unmanaged: true
appveyor.yml:
unmanaged: true
.rspec:
unmanaged: true
Loading