mirror of
https://github.com/ardichoke/puppet-arpwatch.git
synced 2026-05-11 02:15:37 -04:00
PDK Updates, clean up module
Update PDK framework. Get rid of old params style of module writing and replace with Hiera 5 module data.
This commit is contained in:
6
.devcontainer/Dockerfile
Normal file
6
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
FROM puppet/pdk:latest
|
||||||
|
|
||||||
|
# [Optional] Uncomment this section to install additional packages.
|
||||||
|
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
|
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
||||||
|
|
||||||
23
.devcontainer/devcontainer.json
Normal file
23
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
||||||
|
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet
|
||||||
|
{
|
||||||
|
"name": "Puppet Development Kit (Community)",
|
||||||
|
"dockerFile": "Dockerfile",
|
||||||
|
|
||||||
|
// Set *default* container specific settings.json values on container create.
|
||||||
|
"settings": {
|
||||||
|
"terminal.integrated.shell.linux": "/bin/bash"
|
||||||
|
},
|
||||||
|
|
||||||
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
|
"extensions": [
|
||||||
|
"puppet.puppet-vscode",
|
||||||
|
"rebornix.Ruby"
|
||||||
|
]
|
||||||
|
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
// "forwardPorts": [],
|
||||||
|
|
||||||
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
|
// "postCreateCommand": "pdk --version",
|
||||||
|
}
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -25,3 +25,4 @@
|
|||||||
.project
|
.project
|
||||||
.envrc
|
.envrc
|
||||||
/inventory.yaml
|
/inventory.yaml
|
||||||
|
/spec/fixtures/litmus_inventory.yaml
|
||||||
|
|||||||
@@ -3,11 +3,12 @@ stages:
|
|||||||
- syntax
|
- syntax
|
||||||
- unit
|
- unit
|
||||||
|
|
||||||
cache:
|
default:
|
||||||
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- vendor/bundle
|
- vendor/bundle
|
||||||
|
|
||||||
before_script:
|
before_script: &before_script
|
||||||
- bundle -v
|
- bundle -v
|
||||||
- rm Gemfile.lock || true
|
- rm Gemfile.lock || true
|
||||||
- "# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner"
|
- "# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner"
|
||||||
@@ -34,11 +35,19 @@ parallel_spec-Ruby 2.5.7-Puppet ~> 6:
|
|||||||
variables:
|
variables:
|
||||||
PUPPET_GEM_VERSION: '~> 6'
|
PUPPET_GEM_VERSION: '~> 6'
|
||||||
|
|
||||||
parallel_spec-Ruby 2.4.5-Puppet ~> 5:
|
syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.7.2-Puppet ~> 7:
|
||||||
|
stage: syntax
|
||||||
|
image: ruby:2.7.2
|
||||||
|
script:
|
||||||
|
- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
|
||||||
|
variables:
|
||||||
|
PUPPET_GEM_VERSION: '~> 7'
|
||||||
|
|
||||||
|
parallel_spec-Ruby 2.7.2-Puppet ~> 7:
|
||||||
stage: unit
|
stage: unit
|
||||||
image: ruby:2.4.5
|
image: ruby:2.7.2
|
||||||
script:
|
script:
|
||||||
- bundle exec rake parallel_spec
|
- bundle exec rake parallel_spec
|
||||||
variables:
|
variables:
|
||||||
PUPPET_GEM_VERSION: '~> 5'
|
PUPPET_GEM_VERSION: '~> 7'
|
||||||
|
|
||||||
|
|||||||
@@ -25,13 +25,16 @@
|
|||||||
.project
|
.project
|
||||||
.envrc
|
.envrc
|
||||||
/inventory.yaml
|
/inventory.yaml
|
||||||
|
/spec/fixtures/litmus_inventory.yaml
|
||||||
/appveyor.yml
|
/appveyor.yml
|
||||||
|
/.editorconfig
|
||||||
/.fixtures.yml
|
/.fixtures.yml
|
||||||
/Gemfile
|
/Gemfile
|
||||||
/.gitattributes
|
/.gitattributes
|
||||||
/.gitignore
|
/.gitignore
|
||||||
/.gitlab-ci.yml
|
/.gitlab-ci.yml
|
||||||
/.pdkignore
|
/.pdkignore
|
||||||
|
/.puppet-lint.rc
|
||||||
/Rakefile
|
/Rakefile
|
||||||
/rakelib/
|
/rakelib/
|
||||||
/.rspec
|
/.rspec
|
||||||
@@ -40,3 +43,5 @@
|
|||||||
/.yardopts
|
/.yardopts
|
||||||
/spec/
|
/spec/
|
||||||
/.vscode/
|
/.vscode/
|
||||||
|
/.sync.yml
|
||||||
|
/.devcontainer/
|
||||||
|
|||||||
424
.rubocop.yml
424
.rubocop.yml
@@ -1,12 +1,12 @@
|
|||||||
---
|
---
|
||||||
require:
|
require:
|
||||||
|
- rubocop-performance
|
||||||
- rubocop-rspec
|
- rubocop-rspec
|
||||||
- rubocop-i18n
|
|
||||||
AllCops:
|
AllCops:
|
||||||
DisplayCopNames: true
|
DisplayCopNames: true
|
||||||
TargetRubyVersion: '2.1'
|
TargetRubyVersion: '2.4'
|
||||||
Include:
|
Include:
|
||||||
- "./**/*.rb"
|
- "**/*.rb"
|
||||||
Exclude:
|
Exclude:
|
||||||
- bin/*
|
- bin/*
|
||||||
- ".vendor/**/*"
|
- ".vendor/**/*"
|
||||||
@@ -18,16 +18,9 @@ AllCops:
|
|||||||
- "**/Puppetfile"
|
- "**/Puppetfile"
|
||||||
- "**/Vagrantfile"
|
- "**/Vagrantfile"
|
||||||
- "**/Guardfile"
|
- "**/Guardfile"
|
||||||
Metrics/LineLength:
|
Layout/LineLength:
|
||||||
Description: People have wide screens, use them.
|
Description: People have wide screens, use them.
|
||||||
Max: 200
|
Max: 200
|
||||||
GetText:
|
|
||||||
Enabled: false
|
|
||||||
GetText/DecorateString:
|
|
||||||
Description: We don't want to decorate test output.
|
|
||||||
Exclude:
|
|
||||||
- spec/**/*
|
|
||||||
Enabled: false
|
|
||||||
RSpec/BeforeAfterAll:
|
RSpec/BeforeAfterAll:
|
||||||
Description: Beware of using after(:all) as it may cause state to leak between tests.
|
Description: Beware of using after(:all) as it may cause state to leak between tests.
|
||||||
A necessary evil in acceptance testing.
|
A necessary evil in acceptance testing.
|
||||||
@@ -36,14 +29,13 @@ RSpec/BeforeAfterAll:
|
|||||||
RSpec/HookArgument:
|
RSpec/HookArgument:
|
||||||
Description: Prefer explicit :each argument, matching existing module's style
|
Description: Prefer explicit :each argument, matching existing module's style
|
||||||
EnforcedStyle: each
|
EnforcedStyle: each
|
||||||
|
RSpec/DescribeSymbol:
|
||||||
|
Exclude:
|
||||||
|
- spec/unit/facter/**/*.rb
|
||||||
Style/BlockDelimiters:
|
Style/BlockDelimiters:
|
||||||
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
|
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
|
||||||
be consistent then.
|
be consistent then.
|
||||||
EnforcedStyle: braces_for_chaining
|
EnforcedStyle: braces_for_chaining
|
||||||
Style/BracesAroundHashParameters:
|
|
||||||
Description: Braces are required by Ruby 2.7. Cop removed from RuboCop v0.80.0.
|
|
||||||
See https://github.com/rubocop-hq/rubocop/pull/7643
|
|
||||||
Enabled: true
|
|
||||||
Style/ClassAndModuleChildren:
|
Style/ClassAndModuleChildren:
|
||||||
Description: Compact style reduces the required amount of indentation.
|
Description: Compact style reduces the required amount of indentation.
|
||||||
EnforcedStyle: compact
|
EnforcedStyle: compact
|
||||||
@@ -72,7 +64,7 @@ Style/TrailingCommaInArguments:
|
|||||||
Description: Prefer always trailing comma on multiline argument lists. This makes
|
Description: Prefer always trailing comma on multiline argument lists. This makes
|
||||||
diffs, and re-ordering nicer.
|
diffs, and re-ordering nicer.
|
||||||
EnforcedStyleForMultiline: comma
|
EnforcedStyleForMultiline: comma
|
||||||
Style/TrailingCommaInLiteral:
|
Style/TrailingCommaInArrayLiteral:
|
||||||
Description: Prefer always trailing comma on multiline literals. This makes diffs,
|
Description: Prefer always trailing comma on multiline literals. This makes diffs,
|
||||||
and re-ordering nicer.
|
and re-ordering nicer.
|
||||||
EnforcedStyleForMultiline: comma
|
EnforcedStyleForMultiline: comma
|
||||||
@@ -87,26 +79,170 @@ Style/Documentation:
|
|||||||
- spec/**/*
|
- spec/**/*
|
||||||
Style/WordArray:
|
Style/WordArray:
|
||||||
EnforcedStyle: brackets
|
EnforcedStyle: brackets
|
||||||
|
Performance/AncestorsInclude:
|
||||||
|
Enabled: true
|
||||||
|
Performance/BigDecimalWithNumericArgument:
|
||||||
|
Enabled: true
|
||||||
|
Performance/BlockGivenWithExplicitBlock:
|
||||||
|
Enabled: true
|
||||||
|
Performance/CaseWhenSplat:
|
||||||
|
Enabled: true
|
||||||
|
Performance/ConstantRegexp:
|
||||||
|
Enabled: true
|
||||||
|
Performance/MethodObjectAsBlock:
|
||||||
|
Enabled: true
|
||||||
|
Performance/RedundantSortBlock:
|
||||||
|
Enabled: true
|
||||||
|
Performance/RedundantStringChars:
|
||||||
|
Enabled: true
|
||||||
|
Performance/ReverseFirst:
|
||||||
|
Enabled: true
|
||||||
|
Performance/SortReverse:
|
||||||
|
Enabled: true
|
||||||
|
Performance/Squeeze:
|
||||||
|
Enabled: true
|
||||||
|
Performance/StringInclude:
|
||||||
|
Enabled: true
|
||||||
|
Performance/Sum:
|
||||||
|
Enabled: true
|
||||||
Style/CollectionMethods:
|
Style/CollectionMethods:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
Style/MethodCalledOnDoEndBlock:
|
Style/MethodCalledOnDoEndBlock:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
Style/StringMethods:
|
Style/StringMethods:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
GetText/DecorateFunctionMessage:
|
Bundler/InsecureProtocolSource:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
GetText/DecorateStringFormattingUsingInterpolation:
|
Gemspec/DuplicatedAssignment:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
GetText/DecorateStringFormattingUsingPercent:
|
Gemspec/OrderedDependencies:
|
||||||
|
Enabled: false
|
||||||
|
Gemspec/RequiredRubyVersion:
|
||||||
|
Enabled: false
|
||||||
|
Gemspec/RubyVersionGlobalsUsage:
|
||||||
|
Enabled: false
|
||||||
|
Layout/ArgumentAlignment:
|
||||||
|
Enabled: false
|
||||||
|
Layout/BeginEndAlignment:
|
||||||
|
Enabled: false
|
||||||
|
Layout/ClosingHeredocIndentation:
|
||||||
|
Enabled: false
|
||||||
|
Layout/EmptyComment:
|
||||||
|
Enabled: false
|
||||||
|
Layout/EmptyLineAfterGuardClause:
|
||||||
|
Enabled: false
|
||||||
|
Layout/EmptyLinesAroundArguments:
|
||||||
|
Enabled: false
|
||||||
|
Layout/EmptyLinesAroundAttributeAccessor:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Layout/EndOfLine:
|
Layout/EndOfLine:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Layout/IndentHeredoc:
|
Layout/FirstArgumentIndentation:
|
||||||
|
Enabled: false
|
||||||
|
Layout/HashAlignment:
|
||||||
|
Enabled: false
|
||||||
|
Layout/HeredocIndentation:
|
||||||
|
Enabled: false
|
||||||
|
Layout/LeadingEmptyLines:
|
||||||
|
Enabled: false
|
||||||
|
Layout/SpaceAroundMethodCallOperator:
|
||||||
|
Enabled: false
|
||||||
|
Layout/SpaceInsideArrayLiteralBrackets:
|
||||||
|
Enabled: false
|
||||||
|
Layout/SpaceInsideReferenceBrackets:
|
||||||
|
Enabled: false
|
||||||
|
Lint/BigDecimalNew:
|
||||||
|
Enabled: false
|
||||||
|
Lint/BooleanSymbol:
|
||||||
|
Enabled: false
|
||||||
|
Lint/ConstantDefinitionInBlock:
|
||||||
|
Enabled: false
|
||||||
|
Lint/DeprecatedOpenSSLConstant:
|
||||||
|
Enabled: false
|
||||||
|
Lint/DisjunctiveAssignmentInConstructor:
|
||||||
|
Enabled: false
|
||||||
|
Lint/DuplicateElsifCondition:
|
||||||
|
Enabled: false
|
||||||
|
Lint/DuplicateRequire:
|
||||||
|
Enabled: false
|
||||||
|
Lint/DuplicateRescueException:
|
||||||
|
Enabled: false
|
||||||
|
Lint/EmptyConditionalBody:
|
||||||
|
Enabled: false
|
||||||
|
Lint/EmptyFile:
|
||||||
|
Enabled: false
|
||||||
|
Lint/ErbNewArguments:
|
||||||
|
Enabled: false
|
||||||
|
Lint/FloatComparison:
|
||||||
|
Enabled: false
|
||||||
|
Lint/HashCompareByIdentity:
|
||||||
|
Enabled: false
|
||||||
|
Lint/IdentityComparison:
|
||||||
|
Enabled: false
|
||||||
|
Lint/InterpolationCheck:
|
||||||
|
Enabled: false
|
||||||
|
Lint/MissingCopEnableDirective:
|
||||||
|
Enabled: false
|
||||||
|
Lint/MixedRegexpCaptureTypes:
|
||||||
|
Enabled: false
|
||||||
|
Lint/NestedPercentLiteral:
|
||||||
|
Enabled: false
|
||||||
|
Lint/NonDeterministicRequireOrder:
|
||||||
|
Enabled: false
|
||||||
|
Lint/OrderedMagicComments:
|
||||||
|
Enabled: false
|
||||||
|
Lint/OutOfRangeRegexpRef:
|
||||||
|
Enabled: false
|
||||||
|
Lint/RaiseException:
|
||||||
|
Enabled: false
|
||||||
|
Lint/RedundantCopEnableDirective:
|
||||||
|
Enabled: false
|
||||||
|
Lint/RedundantRequireStatement:
|
||||||
|
Enabled: false
|
||||||
|
Lint/RedundantSafeNavigation:
|
||||||
|
Enabled: false
|
||||||
|
Lint/RedundantWithIndex:
|
||||||
|
Enabled: false
|
||||||
|
Lint/RedundantWithObject:
|
||||||
|
Enabled: false
|
||||||
|
Lint/RegexpAsCondition:
|
||||||
|
Enabled: false
|
||||||
|
Lint/ReturnInVoidContext:
|
||||||
|
Enabled: false
|
||||||
|
Lint/SafeNavigationConsistency:
|
||||||
|
Enabled: false
|
||||||
|
Lint/SafeNavigationWithEmpty:
|
||||||
|
Enabled: false
|
||||||
|
Lint/SelfAssignment:
|
||||||
|
Enabled: false
|
||||||
|
Lint/SendWithMixinArgument:
|
||||||
|
Enabled: false
|
||||||
|
Lint/ShadowedArgument:
|
||||||
|
Enabled: false
|
||||||
|
Lint/StructNewOverride:
|
||||||
|
Enabled: false
|
||||||
|
Lint/ToJSON:
|
||||||
|
Enabled: false
|
||||||
|
Lint/TopLevelReturnWithArgument:
|
||||||
|
Enabled: false
|
||||||
|
Lint/TrailingCommaInAttributeDeclaration:
|
||||||
|
Enabled: false
|
||||||
|
Lint/UnreachableLoop:
|
||||||
|
Enabled: false
|
||||||
|
Lint/UriEscapeUnescape:
|
||||||
|
Enabled: false
|
||||||
|
Lint/UriRegexp:
|
||||||
|
Enabled: false
|
||||||
|
Lint/UselessMethodDefinition:
|
||||||
|
Enabled: false
|
||||||
|
Lint/UselessTimes:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Metrics/AbcSize:
|
Metrics/AbcSize:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Metrics/BlockLength:
|
Metrics/BlockLength:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
Metrics/BlockNesting:
|
||||||
|
Enabled: false
|
||||||
Metrics/ClassLength:
|
Metrics/ClassLength:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Metrics/CyclomaticComplexity:
|
Metrics/CyclomaticComplexity:
|
||||||
@@ -119,19 +255,265 @@ Metrics/ParameterLists:
|
|||||||
Enabled: false
|
Enabled: false
|
||||||
Metrics/PerceivedComplexity:
|
Metrics/PerceivedComplexity:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
Migration/DepartmentName:
|
||||||
|
Enabled: false
|
||||||
|
Naming/AccessorMethodName:
|
||||||
|
Enabled: false
|
||||||
|
Naming/BlockParameterName:
|
||||||
|
Enabled: false
|
||||||
|
Naming/HeredocDelimiterCase:
|
||||||
|
Enabled: false
|
||||||
|
Naming/HeredocDelimiterNaming:
|
||||||
|
Enabled: false
|
||||||
|
Naming/MemoizedInstanceVariableName:
|
||||||
|
Enabled: false
|
||||||
|
Naming/MethodParameterName:
|
||||||
|
Enabled: false
|
||||||
|
Naming/RescuedExceptionsVariableName:
|
||||||
|
Enabled: false
|
||||||
|
Naming/VariableNumber:
|
||||||
|
Enabled: false
|
||||||
|
Performance/BindCall:
|
||||||
|
Enabled: false
|
||||||
|
Performance/DeletePrefix:
|
||||||
|
Enabled: false
|
||||||
|
Performance/DeleteSuffix:
|
||||||
|
Enabled: false
|
||||||
|
Performance/InefficientHashSearch:
|
||||||
|
Enabled: false
|
||||||
|
Performance/UnfreezeString:
|
||||||
|
Enabled: false
|
||||||
|
Performance/UriDefaultParser:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/Be:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/Capybara/CurrentPathExpectation:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/Capybara/FeatureMethods:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/Capybara/VisibilityMatcher:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/ContextMethod:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/ContextWording:
|
||||||
|
Enabled: false
|
||||||
RSpec/DescribeClass:
|
RSpec/DescribeClass:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
RSpec/EmptyHook:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/EmptyLineAfterExample:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/EmptyLineAfterExampleGroup:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/EmptyLineAfterHook:
|
||||||
|
Enabled: false
|
||||||
RSpec/ExampleLength:
|
RSpec/ExampleLength:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
RSpec/MessageExpectation:
|
RSpec/ExampleWithoutDescription:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/ExpectChange:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/ExpectInHook:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/FactoryBot/AttributeDefinedStatically:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/FactoryBot/CreateList:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/FactoryBot/FactoryClassName:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/HooksBeforeExamples:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/ImplicitBlockExpectation:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/ImplicitSubject:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/LeakyConstantDeclaration:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/LetBeforeExamples:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/MissingExampleGroupArgument:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
RSpec/MultipleExpectations:
|
RSpec/MultipleExpectations:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
RSpec/MultipleMemoizedHelpers:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/MultipleSubjects:
|
||||||
|
Enabled: false
|
||||||
RSpec/NestedGroups:
|
RSpec/NestedGroups:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
RSpec/PredicateMatcher:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/ReceiveCounts:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/ReceiveNever:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/RepeatedExampleGroupBody:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/RepeatedExampleGroupDescription:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/RepeatedIncludeExample:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/ReturnFromStub:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/SharedExamples:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/StubbedMock:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/UnspecifiedException:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/VariableDefinition:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/VoidExpect:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/Yield:
|
||||||
|
Enabled: false
|
||||||
|
Security/Open:
|
||||||
|
Enabled: false
|
||||||
|
Style/AccessModifierDeclarations:
|
||||||
|
Enabled: false
|
||||||
|
Style/AccessorGrouping:
|
||||||
|
Enabled: false
|
||||||
Style/AsciiComments:
|
Style/AsciiComments:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
Style/BisectedAttrAccessor:
|
||||||
|
Enabled: false
|
||||||
|
Style/CaseLikeIf:
|
||||||
|
Enabled: false
|
||||||
|
Style/ClassEqualityComparison:
|
||||||
|
Enabled: false
|
||||||
|
Style/ColonMethodDefinition:
|
||||||
|
Enabled: false
|
||||||
|
Style/CombinableLoops:
|
||||||
|
Enabled: false
|
||||||
|
Style/CommentedKeyword:
|
||||||
|
Enabled: false
|
||||||
|
Style/Dir:
|
||||||
|
Enabled: false
|
||||||
|
Style/DoubleCopDisableDirective:
|
||||||
|
Enabled: false
|
||||||
|
Style/EmptyBlockParameter:
|
||||||
|
Enabled: false
|
||||||
|
Style/EmptyLambdaParameter:
|
||||||
|
Enabled: false
|
||||||
|
Style/Encoding:
|
||||||
|
Enabled: false
|
||||||
|
Style/EvalWithLocation:
|
||||||
|
Enabled: false
|
||||||
|
Style/ExpandPathArguments:
|
||||||
|
Enabled: false
|
||||||
|
Style/ExplicitBlockArgument:
|
||||||
|
Enabled: false
|
||||||
|
Style/ExponentialNotation:
|
||||||
|
Enabled: false
|
||||||
|
Style/FloatDivision:
|
||||||
|
Enabled: false
|
||||||
|
Style/FrozenStringLiteralComment:
|
||||||
|
Enabled: false
|
||||||
|
Style/GlobalStdStream:
|
||||||
|
Enabled: false
|
||||||
|
Style/HashAsLastArrayItem:
|
||||||
|
Enabled: false
|
||||||
|
Style/HashLikeCase:
|
||||||
|
Enabled: false
|
||||||
|
Style/HashTransformKeys:
|
||||||
|
Enabled: false
|
||||||
|
Style/HashTransformValues:
|
||||||
|
Enabled: false
|
||||||
Style/IfUnlessModifier:
|
Style/IfUnlessModifier:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
Style/KeywordParametersOrder:
|
||||||
|
Enabled: false
|
||||||
|
Style/MinMax:
|
||||||
|
Enabled: false
|
||||||
|
Style/MixinUsage:
|
||||||
|
Enabled: false
|
||||||
|
Style/MultilineWhenThen:
|
||||||
|
Enabled: false
|
||||||
|
Style/NegatedUnless:
|
||||||
|
Enabled: false
|
||||||
|
Style/NumericPredicate:
|
||||||
|
Enabled: false
|
||||||
|
Style/OptionalBooleanParameter:
|
||||||
|
Enabled: false
|
||||||
|
Style/OrAssignment:
|
||||||
|
Enabled: false
|
||||||
|
Style/RandomWithOffset:
|
||||||
|
Enabled: false
|
||||||
|
Style/RedundantAssignment:
|
||||||
|
Enabled: false
|
||||||
|
Style/RedundantCondition:
|
||||||
|
Enabled: false
|
||||||
|
Style/RedundantConditional:
|
||||||
|
Enabled: false
|
||||||
|
Style/RedundantFetchBlock:
|
||||||
|
Enabled: false
|
||||||
|
Style/RedundantFileExtensionInRequire:
|
||||||
|
Enabled: false
|
||||||
|
Style/RedundantRegexpCharacterClass:
|
||||||
|
Enabled: false
|
||||||
|
Style/RedundantRegexpEscape:
|
||||||
|
Enabled: false
|
||||||
|
Style/RedundantSelfAssignment:
|
||||||
|
Enabled: false
|
||||||
|
Style/RedundantSort:
|
||||||
|
Enabled: false
|
||||||
|
Style/RescueStandardError:
|
||||||
|
Enabled: false
|
||||||
|
Style/SingleArgumentDig:
|
||||||
|
Enabled: false
|
||||||
|
Style/SlicingWithRange:
|
||||||
|
Enabled: false
|
||||||
|
Style/SoleNestedConditional:
|
||||||
|
Enabled: false
|
||||||
|
Style/StderrPuts:
|
||||||
|
Enabled: false
|
||||||
|
Style/StringConcatenation:
|
||||||
|
Enabled: false
|
||||||
|
Style/Strip:
|
||||||
|
Enabled: false
|
||||||
Style/SymbolProc:
|
Style/SymbolProc:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
Style/TrailingBodyOnClass:
|
||||||
|
Enabled: false
|
||||||
|
Style/TrailingBodyOnMethodDefinition:
|
||||||
|
Enabled: false
|
||||||
|
Style/TrailingBodyOnModule:
|
||||||
|
Enabled: false
|
||||||
|
Style/TrailingCommaInHashLiteral:
|
||||||
|
Enabled: false
|
||||||
|
Style/TrailingMethodEndStatement:
|
||||||
|
Enabled: false
|
||||||
|
Style/UnpackFirst:
|
||||||
|
Enabled: false
|
||||||
|
Lint/DuplicateBranch:
|
||||||
|
Enabled: false
|
||||||
|
Lint/DuplicateRegexpCharacterClassElement:
|
||||||
|
Enabled: false
|
||||||
|
Lint/EmptyBlock:
|
||||||
|
Enabled: false
|
||||||
|
Lint/EmptyClass:
|
||||||
|
Enabled: false
|
||||||
|
Lint/NoReturnInBeginEndBlocks:
|
||||||
|
Enabled: false
|
||||||
|
Lint/ToEnumArguments:
|
||||||
|
Enabled: false
|
||||||
|
Lint/UnexpectedBlockArity:
|
||||||
|
Enabled: false
|
||||||
|
Lint/UnmodifiedReduceAccumulator:
|
||||||
|
Enabled: false
|
||||||
|
Performance/CollectionLiteralInLoop:
|
||||||
|
Enabled: false
|
||||||
|
Style/ArgumentsForwarding:
|
||||||
|
Enabled: false
|
||||||
|
Style/CollectionCompact:
|
||||||
|
Enabled: false
|
||||||
|
Style/DocumentDynamicEvalDefinition:
|
||||||
|
Enabled: false
|
||||||
|
Style/NegatedIfElseCondition:
|
||||||
|
Enabled: false
|
||||||
|
Style/NilLambda:
|
||||||
|
Enabled: false
|
||||||
|
Style/RedundantArgument:
|
||||||
|
Enabled: false
|
||||||
|
Style/SwapValues:
|
||||||
|
Enabled: false
|
||||||
|
|||||||
@@ -30,10 +30,6 @@ jobs:
|
|||||||
-
|
-
|
||||||
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
|
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
|
||||||
stage: static
|
stage: static
|
||||||
-
|
|
||||||
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
|
|
||||||
rvm: 2.4.5
|
|
||||||
stage: spec
|
|
||||||
-
|
-
|
||||||
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
|
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
|
||||||
rvm: 2.5.7
|
rvm: 2.5.7
|
||||||
@@ -43,7 +39,7 @@ jobs:
|
|||||||
stage: deploy
|
stage: deploy
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- main
|
||||||
- /^v\d/
|
- /^v\d/
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
|||||||
28
Gemfile
28
Gemfile
@@ -17,17 +17,17 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
|
|||||||
minor_version = ruby_version_segments[0..1].join('.')
|
minor_version = ruby_version_segments[0..1].join('.')
|
||||||
|
|
||||||
group :development do
|
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.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 "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 "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 2.8.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
|
||||||
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
|
gem "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
|
||||||
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
|
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
|
||||||
gem "puppet-module-win-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
||||||
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
||||||
|
end
|
||||||
|
group :system_tests do
|
||||||
|
gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
|
||||||
|
gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
||||||
end
|
end
|
||||||
|
|
||||||
puppet_version = ENV['PUPPET_GEM_VERSION']
|
puppet_version = ENV['PUPPET_GEM_VERSION']
|
||||||
@@ -44,16 +44,6 @@ gems['puppet'] = location_for(puppet_version)
|
|||||||
gems['facter'] = location_for(facter_version) if facter_version
|
gems['facter'] = location_for(facter_version) if facter_version
|
||||||
gems['hiera'] = location_for(hiera_version) if hiera_version
|
gems['hiera'] = location_for(hiera_version) if hiera_version
|
||||||
|
|
||||||
if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
|
|
||||||
# If we're using a Puppet gem on Windows which handles its own win32-xxx gem
|
|
||||||
# dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
|
|
||||||
gems['win32-dir'] = ['<= 0.4.9', require: false]
|
|
||||||
gems['win32-eventlog'] = ['<= 0.6.5', require: false]
|
|
||||||
gems['win32-process'] = ['<= 0.7.5', require: false]
|
|
||||||
gems['win32-security'] = ['<= 0.2.5', require: false]
|
|
||||||
gems['win32-service'] = ['0.8.8', require: false]
|
|
||||||
end
|
|
||||||
|
|
||||||
gems.each do |gem_name, gem_params|
|
gems.each do |gem_name, gem_params|
|
||||||
gem gem_name, *gem_params
|
gem gem_name, *gem_params
|
||||||
end
|
end
|
||||||
|
|||||||
1
Rakefile
1
Rakefile
@@ -1,5 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'bundler'
|
||||||
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
|
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
|
||||||
require 'puppetlabs_spec_helper/rake_tasks'
|
require 'puppetlabs_spec_helper/rake_tasks'
|
||||||
require 'puppet-syntax/tasks/puppet-syntax'
|
require 'puppet-syntax/tasks/puppet-syntax'
|
||||||
|
|||||||
12
appveyor.yml
12
appveyor.yml
@@ -2,7 +2,7 @@
|
|||||||
version: 1.1.x.{build}
|
version: 1.1.x.{build}
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- main
|
||||||
- release
|
- release
|
||||||
skip_commits:
|
skip_commits:
|
||||||
message: /^\(?doc\)?.*/
|
message: /^\(?doc\)?.*/
|
||||||
@@ -16,16 +16,8 @@ init:
|
|||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
-
|
-
|
||||||
RUBY_VERSION: 24-x64
|
RUBY_VERSION: 25-x64
|
||||||
CHECK: syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
|
CHECK: syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
|
||||||
-
|
|
||||||
PUPPET_GEM_VERSION: ~> 5.0
|
|
||||||
RUBY_VERSION: 24
|
|
||||||
CHECK: parallel_spec
|
|
||||||
-
|
|
||||||
PUPPET_GEM_VERSION: ~> 5.0
|
|
||||||
RUBY_VERSION: 24-x64
|
|
||||||
CHECK: parallel_spec
|
|
||||||
-
|
-
|
||||||
PUPPET_GEM_VERSION: ~> 6.0
|
PUPPET_GEM_VERSION: ~> 6.0
|
||||||
RUBY_VERSION: 25
|
RUBY_VERSION: 25
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
--- {}
|
---
|
||||||
|
|||||||
1
data/os/Debian.yaml
Normal file
1
data/os/Debian.yaml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
---
|
||||||
4
data/os/RedHat.yaml
Normal file
4
data/os/RedHat.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
arpwatch::config_file: /etc/sysconfig/arpwatch
|
||||||
|
arpwatch::config_template: arpwatch/conf.rhel.erb
|
||||||
|
arpwatch::opts: ''
|
||||||
@@ -21,22 +21,22 @@
|
|||||||
# @param [String] service_ensure Ensure value, passed to the service resource
|
# @param [String] service_ensure Ensure value, passed to the service resource
|
||||||
# @param [String] service_name Name of the service to manage
|
# @param [String] service_name Name of the service to manage
|
||||||
# @param [String] service_user Defines the user account that arpwatch will run under
|
# @param [String] service_user Defines the user account that arpwatch will run under
|
||||||
# @param [String] source_email Define the source email address for arpwatch alerts (RedHat only)
|
# @param [String] source_email Define the source email address for arpwatch alerts
|
||||||
#
|
#
|
||||||
class arpwatch (
|
class arpwatch (
|
||||||
$config_file = $arpwatch::params::config_file,
|
$config_file = '/etc/default/arpwatch',
|
||||||
$config_template = $arpwatch::params::config_template,
|
$config_template = 'arpwatch/conf.deb.erb',
|
||||||
$dest_email = '-',
|
$dest_email = '-',
|
||||||
$interface = $arpwatch::params::interface,
|
$interface = 'eth0',
|
||||||
$opts = $arpwatch::params::opts,
|
$opts = '-N -p',
|
||||||
$package_ensure = 'installed',
|
$package_ensure = 'installed',
|
||||||
$package_name = $arpwatch::params::package_name,
|
$package_name = 'arpwatch',
|
||||||
$service_enable = true,
|
$service_enable = true,
|
||||||
$service_ensure = 'running',
|
$service_ensure = 'running',
|
||||||
$service_name = $arpwatch::params::service_name,
|
$service_name = 'arpwatch',
|
||||||
$service_user = $arpwatch::params::service_user,
|
$service_user = 'arpwatch',
|
||||||
$source_email = "arpwatch@${::fqdn}",
|
$source_email = "arpwatch@${::fqdn}",
|
||||||
) inherits arpwatch::params {
|
) {
|
||||||
validate_string($dest_email)
|
validate_string($dest_email)
|
||||||
validate_string($package_name)
|
validate_string($package_name)
|
||||||
validate_string($service_user)
|
validate_string($service_user)
|
||||||
@@ -65,5 +65,7 @@ class arpwatch (
|
|||||||
ensure => $service_ensure,
|
ensure => $service_ensure,
|
||||||
enable => $service_enable,
|
enable => $service_enable,
|
||||||
}
|
}
|
||||||
Package[$package_name]->File[$config_file]~>Service[$service_name]
|
Package[$package_name]
|
||||||
|
-> File[$config_file]
|
||||||
|
~> Service[$service_name]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
# Class: arpwatch::params
|
|
||||||
# ========================
|
|
||||||
class arpwatch::params {
|
|
||||||
$package_name = 'arpwatch'
|
|
||||||
$service_name = 'arpwatch'
|
|
||||||
|
|
||||||
case $::osfamily {
|
|
||||||
'RedHat': {
|
|
||||||
$interface = 'eth0'
|
|
||||||
$config_file = '/etc/sysconfig/arpwatch'
|
|
||||||
$config_template = 'arpwatch/conf.rhel.erb'
|
|
||||||
$opts = ''
|
|
||||||
$service_user = $::operatingsystemmajrelease ? {
|
|
||||||
'5' => 'pcap',
|
|
||||||
default => 'arpwatch',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'Debian': {
|
|
||||||
$interface = 'eth0'
|
|
||||||
$config_file = '/etc/default/arpwatch'
|
|
||||||
$config_template = 'arpwatch/conf.deb.erb'
|
|
||||||
$service_user = 'arpwatch'
|
|
||||||
$opts = '-N -p'
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
fail("The ${module_name} module is not supported on an ${::osfamily} distribution.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ardichoke-arpwatch",
|
"name": "ardichoke-arpwatch",
|
||||||
"version": "0.2.1",
|
"version": "0.3.0",
|
||||||
"author": "ardichoke",
|
"author": "ardichoke",
|
||||||
"summary": "Install and manage arpwatch",
|
"summary": "Install and manage arpwatch",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -10,30 +10,33 @@
|
|||||||
"dependencies": [
|
"dependencies": [
|
||||||
{
|
{
|
||||||
"name": "puppetlabs/stdlib",
|
"name": "puppetlabs/stdlib",
|
||||||
"version_requirement": ">=1.0.0 <5.0.0"
|
"version_requirement": ">=1.0.0 <9.0.0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"operatingsystem_support": [
|
"operatingsystem_support": [
|
||||||
{
|
{
|
||||||
"operatingsystem": "RedHat",
|
"operatingsystem": "RedHat",
|
||||||
"operatingsystemrelease": [
|
"operatingsystemrelease": [
|
||||||
"5",
|
|
||||||
"6",
|
"6",
|
||||||
"7"
|
"7",
|
||||||
|
"8"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"operatingsystem": "Debian",
|
"operatingsystem": "Debian",
|
||||||
"operatingsystemrelease": [
|
"operatingsystemrelease": [
|
||||||
"7",
|
"7",
|
||||||
"8"
|
"8",
|
||||||
|
"9",
|
||||||
|
"10",
|
||||||
|
"11"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"requirements": [
|
"requirements": [
|
||||||
{
|
{
|
||||||
"name": "puppet",
|
"name": "puppet",
|
||||||
"version_requirement": ">= 4.10.0 < 7.0.0"
|
"version_requirement": ">= 4.10.0 < 8.0.0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
@@ -41,7 +44,7 @@
|
|||||||
"network",
|
"network",
|
||||||
"monitoring"
|
"monitoring"
|
||||||
],
|
],
|
||||||
"pdk-version": "1.18.1",
|
"pdk-version": "2.1.1",
|
||||||
"template-url": "pdk-default#1.18.1",
|
"template-url": "pdk-default#2.1.1",
|
||||||
"template-ref": "tags/1.18.1-0-g3d2e75c"
|
"template-ref": "tags/2.1.1-0-g03daa92"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
RSpec.configure do |c|
|
||||||
|
c.mock_with :rspec
|
||||||
|
end
|
||||||
|
|
||||||
require 'puppetlabs_spec_helper/module_spec_helper'
|
require 'puppetlabs_spec_helper/module_spec_helper'
|
||||||
require 'rspec-puppet-facts'
|
require 'rspec-puppet-facts'
|
||||||
|
|
||||||
@@ -43,6 +47,18 @@ RSpec.configure do |c|
|
|||||||
c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT']
|
c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT']
|
||||||
c.after(:suite) do
|
c.after(:suite) do
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Filter backtrace noise
|
||||||
|
backtrace_exclusion_patterns = [
|
||||||
|
%r{spec_helper},
|
||||||
|
%r{gems},
|
||||||
|
]
|
||||||
|
|
||||||
|
if c.respond_to?(:backtrace_exclusion_patterns)
|
||||||
|
c.backtrace_exclusion_patterns = backtrace_exclusion_patterns
|
||||||
|
elsif c.respond_to?(:backtrace_clean_patterns)
|
||||||
|
c.backtrace_clean_patterns = backtrace_exclusion_patterns
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Ensures that a module is defined
|
# Ensures that a module is defined
|
||||||
|
|||||||
Reference in New Issue
Block a user