From 6c1b53b5c7428fd4d924ba461db7ed6ba599936f Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sun, 30 Aug 2020 18:39:17 +0200 Subject: [PATCH 1/3] modulesync 3.0.0 --- .github/CONTRIBUTING.md | 2 + .github/SECURITY.md | 3 + .msync.yml | 2 +- .rubocop.yml | 548 +----------------- .sync.yml | 2 +- .travis.yml | 7 +- Gemfile | 6 +- .../nodesets/ec2/amazonlinux-2016091.yml | 31 - .../nodesets/ec2/image_templates.yaml | 34 -- spec/acceptance/nodesets/ec2/rhel-73-x64.yml | 29 - .../nodesets/ec2/sles-12sp2-x64.yml | 29 - .../nodesets/ec2/ubuntu-1604-x64.yml | 29 - .../nodesets/ec2/windows-2016-base-x64.yml | 29 - spec/spec_helper.rb | 2 +- 14 files changed, 17 insertions(+), 736 deletions(-) create mode 100644 .github/SECURITY.md delete mode 100644 spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml delete mode 100644 spec/acceptance/nodesets/ec2/image_templates.yaml delete mode 100644 spec/acceptance/nodesets/ec2/rhel-73-x64.yml delete mode 100644 spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml delete mode 100644 spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml delete mode 100644 spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 2240a970..a6b64e03 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -33,6 +33,8 @@ By participating in this project you agree to abide by its terms. Please be prepared to repeat some of these steps as our contributors review your code. +Also consider sending in your profile code that calls this component module as an acceptance test or provide it via an issue. This helps reviewers a lot to test your use case and prevents future regressions! + ## Writing proper commits - short version * Make commits of logical units. diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 00000000..cacadf22 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,3 @@ +# Vox Pupuli Security Policy + +Our vulnerabilities reporting process is at https://voxpupuli.org/security/ diff --git a/.msync.yml b/.msync.yml index 8864fc09..4c7999c4 100644 --- a/.msync.yml +++ b/.msync.yml @@ -1 +1 @@ -modulesync_config_version: '2.12.0' +modulesync_config_version: '3.0.0' diff --git a/.rubocop.yml b/.rubocop.yml index c2ebc88d..c0fd4889 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,546 +1,2 @@ -require: rubocop-rspec -AllCops: -# Puppet Server 5 defaults to jruby 1.7 so TargetRubyVersion must stay at 1.9 until we drop support for puppet 5 - TargetRubyVersion: 1.9 - Include: - - ./**/*.rb - Exclude: - - files/**/* - - vendor/**/* - - .vendor/**/* - - pkg/**/* - - spec/fixtures/**/* - - Gemfile - - Rakefile - - Guardfile - - Vagrantfile -Lint/ConditionPosition: - Enabled: True - -Lint/ElseLayout: - Enabled: True - -Lint/UnreachableCode: - Enabled: True - -Lint/UselessComparison: - Enabled: True - -Lint/EnsureReturn: - Enabled: True - -Lint/HandleExceptions: - Enabled: True - -Lint/LiteralInCondition: - Enabled: True - -Lint/ShadowingOuterLocalVariable: - Enabled: True - -Lint/LiteralInInterpolation: - Enabled: True - -Style/HashSyntax: - Enabled: True - -Style/RedundantReturn: - Enabled: True - -Layout/EndOfLine: - Enabled: False - -Lint/AmbiguousOperator: - Enabled: True - -Lint/AssignmentInCondition: - Enabled: True - -Layout/SpaceBeforeComment: - Enabled: True - -Style/AndOr: - Enabled: True - -Style/RedundantSelf: - Enabled: True - -Metrics/BlockLength: - Enabled: False - -# Method length is not necessarily an indicator of code quality -Metrics/MethodLength: - Enabled: False - -# Module length is not necessarily an indicator of code quality -Metrics/ModuleLength: - Enabled: False - -Style/WhileUntilModifier: - Enabled: True - -Lint/AmbiguousRegexpLiteral: - Enabled: True - -Security/Eval: - Enabled: True - -Lint/BlockAlignment: - Enabled: True - -Lint/DefEndAlignment: - Enabled: True - -Lint/EndAlignment: - Enabled: True - -Lint/DeprecatedClassMethods: - Enabled: True - -Lint/Loop: - Enabled: True - -Lint/ParenthesesAsGroupedExpression: - Enabled: True - -Lint/RescueException: - Enabled: True - -Lint/StringConversionInInterpolation: - Enabled: True - -Lint/UnusedBlockArgument: - Enabled: True - -Lint/UnusedMethodArgument: - Enabled: True - -Lint/UselessAccessModifier: - Enabled: True - -Lint/UselessAssignment: - Enabled: True - -Lint/Void: - Enabled: True - -Layout/AccessModifierIndentation: - Enabled: True - -Style/AccessorMethodName: - Enabled: True - -Style/Alias: - Enabled: True - -Layout/AlignArray: - Enabled: True - -Layout/AlignHash: - Enabled: True - -Layout/AlignParameters: - Enabled: True - -Metrics/BlockNesting: - Enabled: True - -Style/AsciiComments: - Enabled: True - -Style/Attr: - Enabled: True - -Style/BracesAroundHashParameters: - Enabled: True - -Style/CaseEquality: - Enabled: True - -Layout/CaseIndentation: - Enabled: True - -Style/CharacterLiteral: - Enabled: True - -Style/ClassAndModuleCamelCase: - Enabled: True - -Style/ClassAndModuleChildren: - Enabled: False - -Style/ClassCheck: - Enabled: True - -# Class length is not necessarily an indicator of code quality -Metrics/ClassLength: - Enabled: False - -Style/ClassMethods: - Enabled: True - -Style/ClassVars: - Enabled: True - -Style/WhenThen: - Enabled: True - -Style/WordArray: - Enabled: True - -Style/UnneededPercentQ: - Enabled: True - -Layout/Tab: - Enabled: True - -Layout/SpaceBeforeSemicolon: - Enabled: True - -Layout/TrailingBlankLines: - Enabled: True - -Layout/SpaceInsideBlockBraces: - Enabled: True - -Layout/SpaceInsideBrackets: - Enabled: True - -Layout/SpaceInsideHashLiteralBraces: - Enabled: True - -Layout/SpaceInsideParens: - Enabled: True - -Layout/LeadingCommentSpace: - Enabled: True - -Layout/SpaceBeforeFirstArg: - Enabled: True - -Layout/SpaceAfterColon: - Enabled: True - -Layout/SpaceAfterComma: - Enabled: True - -Layout/SpaceAfterMethodName: - Enabled: True - -Layout/SpaceAfterNot: - Enabled: True - -Layout/SpaceAfterSemicolon: - Enabled: True - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: True - -Layout/SpaceAroundOperators: - Enabled: True - -Layout/SpaceBeforeBlockBraces: - Enabled: True - -Layout/SpaceBeforeComma: - Enabled: True - -Style/CollectionMethods: - Enabled: True - -Layout/CommentIndentation: - Enabled: True - -Style/ColonMethodCall: - Enabled: True - -Style/CommentAnnotation: - Enabled: True - -# 'Complexity' is very relative -Metrics/CyclomaticComplexity: - Enabled: False - -Style/ConstantName: - Enabled: True - -Style/Documentation: - Enabled: False - -Style/DefWithParentheses: - Enabled: True - -Style/PreferredHashMethods: - Enabled: True - -Layout/DotPosition: - EnforcedStyle: trailing - -Style/DoubleNegation: - Enabled: True - -Style/EachWithObject: - Enabled: True - -Layout/EmptyLineBetweenDefs: - Enabled: True - -Layout/IndentArray: - Enabled: True - -Layout/IndentHash: - Enabled: True - -Layout/IndentationConsistency: - Enabled: True - -Layout/IndentationWidth: - Enabled: True - -Layout/EmptyLines: - Enabled: True - -Layout/EmptyLinesAroundAccessModifier: - Enabled: True - -Style/EmptyLiteral: - Enabled: True - -# Configuration parameters: AllowURI, URISchemes. -Metrics/LineLength: - Enabled: False - -Style/MethodCallWithoutArgsParentheses: - Enabled: True - -Style/MethodDefParentheses: - Enabled: True - -Style/LineEndConcatenation: - Enabled: True - -Layout/TrailingWhitespace: - Enabled: True - -Style/StringLiterals: - Enabled: True - -Style/TrailingCommaInArguments: - Enabled: True - -Style/TrailingCommaInLiteral: - Enabled: True - -Style/GlobalVars: - Enabled: True - -Style/GuardClause: - Enabled: True - -Style/IfUnlessModifier: - Enabled: True - -Style/MultilineIfThen: - Enabled: True - -Style/NegatedIf: - Enabled: True - -Style/NegatedWhile: - Enabled: True - -Style/Next: - Enabled: True - -Style/SingleLineBlockParams: - Enabled: True - -Style/SingleLineMethods: - Enabled: True - -Style/SpecialGlobalVars: - Enabled: True - -Style/TrivialAccessors: - Enabled: True - -Style/UnlessElse: - Enabled: True - -Style/VariableInterpolation: - Enabled: True - -Style/VariableName: - Enabled: True - -Style/WhileUntilDo: - Enabled: True - -Style/EvenOdd: - Enabled: True - -Style/FileName: - Enabled: True - -Style/For: - Enabled: True - -Style/Lambda: - Enabled: True - -Style/MethodName: - Enabled: True - -Style/MultilineTernaryOperator: - Enabled: True - -Style/NestedTernaryOperator: - Enabled: True - -Style/NilComparison: - Enabled: True - -Style/FormatString: - Enabled: True - -Style/MultilineBlockChain: - Enabled: True - -Style/Semicolon: - Enabled: True - -Style/SignalException: - Enabled: True - -Style/NonNilCheck: - Enabled: True - -Style/Not: - Enabled: True - -Style/NumericLiterals: - Enabled: True - -Style/OneLineConditional: - Enabled: True - -Style/OpMethod: - Enabled: True - -Style/ParenthesesAroundCondition: - Enabled: True - -Style/PercentLiteralDelimiters: - Enabled: True - -Style/PerlBackrefs: - Enabled: True - -Style/PredicateName: - Enabled: True - -Style/RedundantException: - Enabled: True - -Style/SelfAssignment: - Enabled: True - -Style/Proc: - Enabled: True - -Style/RaiseArgs: - Enabled: True - -Style/RedundantBegin: - Enabled: True - -Style/RescueModifier: - Enabled: True - -# based on https://github.com/voxpupuli/modulesync_config/issues/168 -Style/RegexpLiteral: - EnforcedStyle: percent_r - Enabled: True - -Lint/UnderscorePrefixedVariableName: - Enabled: True - -Metrics/ParameterLists: - Enabled: False - -Lint/RequireParentheses: - Enabled: True - -Style/ModuleFunction: - Enabled: True - -Lint/Debugger: - Enabled: True - -Style/IfWithSemicolon: - Enabled: True - -Style/Encoding: - Enabled: True - -Style/BlockDelimiters: - Enabled: True - -Layout/MultilineBlockLayout: - Enabled: True - -# 'Complexity' is very relative -Metrics/AbcSize: - Enabled: False - -# 'Complexity' is very relative -Metrics/PerceivedComplexity: - Enabled: False - -Lint/UselessAssignment: - Enabled: True - -Layout/ClosingParenthesisIndentation: - Enabled: True - -# RSpec - -RSpec/BeforeAfterAll: - Exclude: - - spec/acceptance/**/* - -# We don't use rspec in this way -RSpec/DescribeClass: - Enabled: False - -# Example length is not necessarily an indicator of code quality -RSpec/ExampleLength: - Enabled: False - -RSpec/NamedSubject: - Enabled: False - -# disabled for now since they cause a lot of issues -# these issues aren't easy to fix -RSpec/RepeatedDescription: - Enabled: False - -RSpec/NestedGroups: - Enabled: False - -# this is broken on ruby1.9 -Layout/IndentHeredoc: - Enabled: False - -# disable Yaml safe_load. This is needed to support ruby2.0.0 development envs -Security/YAMLLoad: - Enabled: false - -# This affects hiera interpolation, as well as some configs that we push. -Style/FormatStringToken: - Enabled: false - -# This is useful, but sometimes a little too picky about where unit tests files -# are located. -RSpec/FilePath: - Enabled: false +inherit_gem: + voxpupuli-test: rubocop.yml diff --git a/.sync.yml b/.sync.yml index cb6bca84..b2d9d45d 100644 --- a/.sync.yml +++ b/.sync.yml @@ -6,7 +6,7 @@ - set: ubuntu1604-64 secure: "OKYO+/kY1KB9EH0pB30AU6E2c5SZbNql+Klg+sb1/LMi+ADjyNEzcfTP6aUhnYedKJf5m8rfycc81UPuUeKaR/U/mPwR1R5OKh+S1KL1yzrRdxdpmLWMX14nBFbAZYvSTe/bPbxhngjW84uHRF2zkkSxKStsIzyy2DcTYayaWZ0=" spec/spec_helper.rb: - mock_with: :mocha + mock_with: ":mocha" spec_overrides: - "require 'spec_helper_corosync'" - "require 'spec_helper_methods'" diff --git a/.travis.yml b/.travis.yml index d96faf77..dcea2855 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ --- -dist: bionic +os: linux +dist: focal language: ruby cache: bundler before_install: @@ -7,7 +8,7 @@ before_install: - bundle --version script: - 'bundle exec rake $CHECK' -matrix: +jobs: fast_finish: true include: - rvm: 2.4.4 @@ -60,7 +61,7 @@ notifications: - "chat.freenode.org#voxpupuli-notifications" deploy: provider: puppetforge - user: puppet + username: puppet password: secure: "OKYO+/kY1KB9EH0pB30AU6E2c5SZbNql+Klg+sb1/LMi+ADjyNEzcfTP6aUhnYedKJf5m8rfycc81UPuUeKaR/U/mPwR1R5OKh+S1KL1yzrRdxdpmLWMX14nBFbAZYvSTe/bPbxhngjW84uHRF2zkkSxKStsIzyy2DcTYayaWZ0=" on: diff --git a/Gemfile b/Gemfile index 32c31146..2fce93ce 100644 --- a/Gemfile +++ b/Gemfile @@ -11,9 +11,9 @@ def location_for(place, fake_version = nil) end group :test do - gem 'voxpupuli-test', '>= 1.0.0', :require => false - gem 'coveralls', :require => false - gem 'simplecov-console', :require => false + gem 'voxpupuli-test', '~> 2.1', :require => false + gem 'coveralls', :require => false + gem 'simplecov-console', :require => false end group :development do diff --git a/spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml b/spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml deleted file mode 100644 index 19dd43ed..00000000 --- a/spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -# -# Additional ~/.fog config file with AWS EC2 credentials -# required. -# -# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md -# -# Amazon Linux is not a RHEL clone. -# -HOSTS: - amazonlinux-2016091-x64: - roles: - - master - platform: centos-6-x86_64 - hypervisor: ec2 - # refers to image_tempaltes.yaml AMI[vmname] entry: - vmname: amazonlinux-2016091-eu-central-1 - # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]: - snapshot: aio - # t2.micro is free tier eligible (https://aws.amazon.com/en/free/): - amisize: t2.micro - # required so that beaker sanitizes sshd_config and root authorized_keys: - user: ec2-user -CONFIG: - type: aio - :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml -... -# vim: syntax=yaml diff --git a/spec/acceptance/nodesets/ec2/image_templates.yaml b/spec/acceptance/nodesets/ec2/image_templates.yaml deleted file mode 100644 index e50593ee..00000000 --- a/spec/acceptance/nodesets/ec2/image_templates.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -# -# see also: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md -# -# Hint: image IDs (ami-*) for the same image are different per location. -# -AMI: - # Amazon Linux AMI 2016.09.1 (HVM), SSD Volume Type - amazonlinux-2016091-eu-central-1: - :image: - :aio: ami-af0fc0c0 - :region: eu-central-1 - # Red Hat Enterprise Linux 7.3 (HVM), SSD Volume Type - rhel-73-eu-central-1: - :image: - :aio: ami-e4c63e8b - :region: eu-central-1 - # SUSE Linux Enterprise Server 12 SP2 (HVM), SSD Volume Type - sles-12sp2-eu-central-1: - :image: - :aio: ami-c425e4ab - :region: eu-central-1 - # Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ubuntu-1604-eu-central-1: - :image: - :aio: ami-fe408091 - :region: eu-central-1 - # Microsoft Windows Server 2016 Base - windows-2016-base-eu-central-1: - :image: - :aio: ami-88ec20e7 - :region: eu-central-1 diff --git a/spec/acceptance/nodesets/ec2/rhel-73-x64.yml b/spec/acceptance/nodesets/ec2/rhel-73-x64.yml deleted file mode 100644 index 7fac8236..00000000 --- a/spec/acceptance/nodesets/ec2/rhel-73-x64.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -# -# Additional ~/.fog config file with AWS EC2 credentials -# required. -# -# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md -# -HOSTS: - rhel-73-x64: - roles: - - master - platform: el-7-x86_64 - hypervisor: ec2 - # refers to image_tempaltes.yaml AMI[vmname] entry: - vmname: rhel-73-eu-central-1 - # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]: - snapshot: aio - # t2.micro is free tier eligible (https://aws.amazon.com/en/free/): - amisize: t2.micro - # required so that beaker sanitizes sshd_config and root authorized_keys: - user: ec2-user -CONFIG: - type: aio - :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml -... -# vim: syntax=yaml diff --git a/spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml b/spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml deleted file mode 100644 index 8542154d..00000000 --- a/spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -# -# Additional ~/.fog config file with AWS EC2 credentials -# required. -# -# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md -# -HOSTS: - sles-12sp2-x64: - roles: - - master - platform: sles-12-x86_64 - hypervisor: ec2 - # refers to image_tempaltes.yaml AMI[vmname] entry: - vmname: sles-12sp2-eu-central-1 - # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]: - snapshot: aio - # t2.micro is free tier eligible (https://aws.amazon.com/en/free/): - amisize: t2.micro - # required so that beaker sanitizes sshd_config and root authorized_keys: - user: ec2-user -CONFIG: - type: aio - :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml -... -# vim: syntax=yaml diff --git a/spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml b/spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml deleted file mode 100644 index 9cf59d59..00000000 --- a/spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -# -# Additional ~/.fog config file with AWS EC2 credentials -# required. -# -# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md -# -HOSTS: - ubuntu-1604-x64: - roles: - - master - platform: ubuntu-16.04-amd64 - hypervisor: ec2 - # refers to image_tempaltes.yaml AMI[vmname] entry: - vmname: ubuntu-1604-eu-central-1 - # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]: - snapshot: aio - # t2.micro is free tier eligible (https://aws.amazon.com/en/free/): - amisize: t2.micro - # required so that beaker sanitizes sshd_config and root authorized_keys: - user: ubuntu -CONFIG: - type: aio - :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml -... -# vim: syntax=yaml diff --git a/spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml b/spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml deleted file mode 100644 index 0932e29c..00000000 --- a/spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -# -# Additional ~/.fog config file with AWS EC2 credentials -# required. -# -# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md -# -HOSTS: - windows-2016-base-x64: - roles: - - master - platform: windows-2016-64 - hypervisor: ec2 - # refers to image_tempaltes.yaml AMI[vmname] entry: - vmname: windows-2016-base-eu-central-1 - # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]: - snapshot: aio - # t2.micro is free tier eligible (https://aws.amazon.com/en/free/): - amisize: t2.micro - # required so that beaker sanitizes sshd_config and root authorized_keys: - user: ec2-user -CONFIG: - type: aio - :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml -... -# vim: syntax=yaml diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9a9bff05..0a5d2899 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,7 +13,7 @@ require 'voxpupuli/test/spec_helper' if File.exist?(File.join(__dir__, 'default_module_facts.yml')) - facts = YAML.load(File.read(File.join(__dir__, 'default_module_facts.yml'))) + facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml'))) if facts facts.each do |name, value| add_custom_fact name.to_sym, value From 4e085b1be5911b3283d52fb7119085835a8a9ecf Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sun, 30 Aug 2020 18:42:27 +0200 Subject: [PATCH 2/3] puppet-lint: autofix --- manifests/init.pp | 17 ++++++++--------- manifests/params.pp | 1 - manifests/qdevice.pp | 2 +- manifests/service.pp | 3 +-- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index b3a2ba30..3c98d25a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -336,7 +336,7 @@ # # Copyright 2012, Puppet Labs, LLC. # -class corosync( +class corosync ( Boolean $enable_secauth = $corosync::params::enable_secauth, Enum['file', 'string'] $authkey_source = $corosync::params::authkey_source, Variant[Stdlib::Filesource,Stdlib::Base64] $authkey = $corosync::params::authkey, @@ -406,7 +406,6 @@ Optional[Integer] $max_messages = undef, Boolean $test_corosync_config = $corosync::params::test_corosync_config, ) inherits ::corosync::params { - if $set_votequorum and (empty($quorum_members) and empty($multicast_address) and !$cluster_name) { fail('set_votequorum is true, so you must set either quorum_members, or one of multicast_address or cluster_name.') } @@ -565,10 +564,10 @@ # If the local data matches auth_node (hostname or primary IP) we can # perform auth processing for subsequent components if $trusted['certname'] == $auth_node - or $trusted['hostname'] == $auth_node - or $auth_node == $facts['networking']['ip'] - or $auth_node in $interface_ip_list { - $is_auth_node = true + or $trusted['hostname'] == $auth_node + or $auth_node == $facts['networking']['ip'] + or $auth_node in $interface_ip_list { + $is_auth_node = true } else { $is_auth_node = false } @@ -729,7 +728,7 @@ # Throws a puppet error if node is on standby exec { 'check_standby node': command => 'echo "Node appears to be on standby" && false', - path => [ '/bin', '/usr/bin', '/sbin', '/usr/sbin' ], + path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin'], onlyif => "crm node status|grep ${facts['networking']['hostname']}-standby|grep 'value=\"on\"'", require => Service['corosync'], } @@ -738,7 +737,7 @@ if $force_online { exec { 'force_online node': command => 'crm node online', - path => [ '/bin', '/usr/bin', '/sbin', '/usr/sbin' ], + path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin'], onlyif => "crm node status|grep ${facts['networking']['hostname']}-standby|grep 'value=\"on\"'", require => Service['corosync'], } @@ -757,7 +756,7 @@ service { 'corosync': ensure => running, enable => $enable_corosync_service, - subscribe => File[ [ '/etc/corosync/corosync.conf', '/etc/corosync/service.d' ] ], + subscribe => File[['/etc/corosync/corosync.conf', '/etc/corosync/service.d']], } } } diff --git a/manifests/params.pp b/manifests/params.pp index 404862f8..1dad627f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -60,5 +60,4 @@ fail("Unsupported operating system: ${facts['os']['name']}") } } - } diff --git a/manifests/qdevice.pp b/manifests/qdevice.pp index b9c5488e..ae93505a 100644 --- a/manifests/qdevice.pp +++ b/manifests/qdevice.pp @@ -58,7 +58,7 @@ $cluster_user = 'hacluster' # Install the required packages - [ $package_pcs, $package_corosync_qnetd ].each |$package| { + [$package_pcs, $package_corosync_qnetd].each |$package| { package { $package: ensure => present, before => Group[$cluster_group], diff --git a/manifests/service.pp b/manifests/service.pp index 77010568..9d92828a 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -27,10 +27,9 @@ # # Copyright 2012 Puppet Labs, LLC. # -define corosync::service( +define corosync::service ( String[1] $version, ) { - file { "/etc/corosync/service.d/${name}": ensure => file, content => template("${module_name}/service.erb"), From e404b5f6c3039c871d1746c4a40bfdf65925fc3f Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sun, 30 Aug 2020 18:44:04 +0200 Subject: [PATCH 3/3] rubocop: autofix --- spec/unit/puppet/type/cs_clone_spec.rb | 4 ++-- spec/unit/puppet/type/cs_group_spec.rb | 4 ++-- spec/unit/puppet/type/cs_location_spec.rb | 4 ++-- spec/unit/puppet/type/cs_primitive_spec.rb | 4 ++-- spec/unit/puppet/type/cs_property_spec.rb | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/unit/puppet/type/cs_clone_spec.rb b/spec/unit/puppet/type/cs_clone_spec.rb index 5bfb0c8c..e98425f4 100644 --- a/spec/unit/puppet/type/cs_clone_spec.rb +++ b/spec/unit/puppet/type/cs_clone_spec.rb @@ -19,7 +19,7 @@ [:name, :cib].each do |param| it "should have a #{param} parameter" do - expect(subject.validparameter?(param)).to be_truthy + expect(subject).to be_validparameter(param) end it "should have documentation for its #{param} parameter" do @@ -30,7 +30,7 @@ [:primitive, :clone_max, :clone_node_max, :notify_clones, :globally_unique, :ordered, :interleave].each do |property| it "should have a #{property} property" do - expect(subject.validproperty?(property)).to be_truthy + expect(subject).to be_validproperty(property) end it "should have documentation for its #{property} property" do diff --git a/spec/unit/puppet/type/cs_group_spec.rb b/spec/unit/puppet/type/cs_group_spec.rb index db375031..01faf37a 100644 --- a/spec/unit/puppet/type/cs_group_spec.rb +++ b/spec/unit/puppet/type/cs_group_spec.rb @@ -19,7 +19,7 @@ [:name, :cib].each do |param| it "should have a #{param} parameter" do - expect(subject.validparameter?(param)).to be_truthy + expect(subject).to be_validparameter(param) end it "should have documentation for its #{param} parameter" do @@ -29,7 +29,7 @@ [:primitives].each do |property| it "should have a #{property} property" do - expect(subject.validproperty?(property)).to be_truthy + expect(subject).to be_validproperty(property) end it "should have documentation for its #{property} property" do diff --git a/spec/unit/puppet/type/cs_location_spec.rb b/spec/unit/puppet/type/cs_location_spec.rb index e4213855..a4fb988e 100644 --- a/spec/unit/puppet/type/cs_location_spec.rb +++ b/spec/unit/puppet/type/cs_location_spec.rb @@ -19,7 +19,7 @@ [:name, :cib].each do |param| it "should have a #{param} parameter" do - expect(subject.validparameter?(param)).to be_truthy + expect(subject).to be_validparameter(param) end it "should have documentation for its #{param} parameter" do @@ -29,7 +29,7 @@ [:primitive, :node_name, :resource_discovery, :score, :rules].each do |property| it "should have a #{property} property" do - expect(subject.validproperty?(property)).to be_truthy + expect(subject).to be_validproperty(property) end it "should have documentation for its #{property} property" do diff --git a/spec/unit/puppet/type/cs_primitive_spec.rb b/spec/unit/puppet/type/cs_primitive_spec.rb index 0a82859d..d13749ff 100644 --- a/spec/unit/puppet/type/cs_primitive_spec.rb +++ b/spec/unit/puppet/type/cs_primitive_spec.rb @@ -19,7 +19,7 @@ [:name, :primitive_class, :primitive_type, :provided_by, :cib].each do |param| it "should have a #{param} parameter" do - expect(subject.validparameter?(param)).to be_truthy + expect(subject).to be_validparameter(param) end it "should have documentation for its #{param} parameter" do @@ -29,7 +29,7 @@ [:parameters, :operations, :metadata, :ms_metadata, :promotable].each do |property| it "should have a #{property} property" do - expect(subject.validproperty?(property)).to be_truthy + expect(subject).to be_validproperty(property) end it "should have documentation for its #{property} property" do diff --git a/spec/unit/puppet/type/cs_property_spec.rb b/spec/unit/puppet/type/cs_property_spec.rb index 7592006f..49b84dde 100644 --- a/spec/unit/puppet/type/cs_property_spec.rb +++ b/spec/unit/puppet/type/cs_property_spec.rb @@ -14,7 +14,7 @@ [:replace].each do |param| it "should have a #{param} parameter" do - expect(subject.validparameter?(param)).to be_truthy + expect(subject).to be_validparameter(param) end it "should have documentation for its #{param} parameter" do @@ -24,7 +24,7 @@ [:value].each do |property| it "should have a #{property} property" do - expect(subject.validproperty?(property)).to be_truthy + expect(subject).to be_validproperty(property) end it "should have documentation for its #{property} property" do