Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(*) Migrate spec to ruby3/puppet8 #1364

Merged
merged 9 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/librarian_puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
ruby-version: 3.2.5
- run: bundle install
- name: Puppetfile recursive dependency check
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rake_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
ruby-version: 3.2.5
- run: bundle install
- name: run rake checks
run: bundle exec rake
133 changes: 9 additions & 124 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,133 +1,18 @@
---
inherit_gem:
voxpupuli-test: rubocop.yml
require:
- rubocop-rspec
- rubocop-rspec
- rubocop-rake
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.7'
NewCops: enable
Include:
- "**/*.rb"
- "**/Gemfile"
- "**/Rakefile"
Exclude:
- ".bundle/**/*"
- "**/Guardfile"
- "modules/**/*"
- "pkg/**/*"
- "**/Puppetfile"
- "spec/fixtures/**/*"
- "**/Vagrantfile"
- ".vendor/**/*"
- "vendor/**/*"
Layout/LineLength:
Description: People have wide screens, use them.
Max: 200
RSpec/BeforeAfterAll:
Description: This rule was also catching before(:context)...
Enabled: false
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/TrailingCommaInArrayLiteral:
Description: Prefer always trailing comma on multiline literals. This makes diffs,
and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
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: percent
Style/CollectionMethods:
Enabled: true
Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/StringMethods:
Enabled: true
Layout/EndOfLine:
Enabled: false
Layout/HeredocIndentation:
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
Style/MixinUsage:
Enabled: false
RSpec/ImplicitSubject:
Enabled: false
TargetRubyVersion: '3.2'
Layout/DotPosition:
EnforcedStyle: leading
Style/CommentedKeyword:
Enabled: false
Naming/FileName:
Enabled: false
RSpec/MultipleMemoizedHelpers:
Enabled: false
RSpec/BeforeAfterAll:
Enabled: false
25 changes: 8 additions & 17 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'coveralls', require: false
gem 'puppet_metadata', '~> 1.0', require: false
gem 'puppet_metadata', '~> 4.0', require: false
gem 'simplecov-console', require: false
gem 'voxpupuli-test', '~> 5.4', require: false
gem 'voxpupuli-test', '~> 9.0', require: false

gem 'puppet-lint-package_ensure-check', '~> 0.2.0', require: false
gem 'puppet-lint-resource_reference_syntax', '~> 1.2.0', require: false
gem 'puppet-lint-strict_indent-check', '~> 2.1.0', require: false
gem 'puppet-lint-unquoted_string-check', '~> 2.2.0', require: false
gem 'puppet-lint-variable_contains_upcase', '~> 1.4.0', require: false

gem 'facterdb', '< 2', require: false # 3.0.0 drops support for EL7

gem 'r10k', require: false
gem 'toml-rb', require: false # puppet/telegraf
gem 'librarian-puppet', require: false
gem 'puppet-lint-package_ensure-check', '~> 0.2.0', require: false
jhoblitt marked this conversation as resolved.
Show resolved Hide resolved
gem 'r10k', require: false
gem 'toml-rb', require: false # puppet/telegraf
end

group :development do
Expand All @@ -30,16 +24,13 @@ group :system_tests do
end

group :release do
gem 'github_changelog_generator', '>= 1.16.1', require: false if RUBY_VERSION >= '2.5'
gem 'voxpupuli-release', '~> 3.0', require: false
end

gem 'facter', ENV['FACTER_GEM_VERSION'], require: false, groups: [:test]
gem 'facter', ENV.fetch('FACTER_GEM_VERSION', nil), require: false, groups: [:test]
gem 'rake', require: false

# See: https://github.com/puppetlabs/puppet/issues/9268
puppetversion = ENV['PUPPET_GEM_VERSION'] || '~> 7.28.0'
puppetversion = ENV['PUPPET_GEM_VERSION'] || '~> 8.9'
gem 'puppet', puppetversion, require: false, groups: [:test]

gem 'librarian-puppet'
# vim: syntax=ruby
16 changes: 8 additions & 8 deletions hieradata/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ sssd::main_config:
auth_provider: "ipa"
access_provider: "ipa"
ldap_tls_cacert: "/etc/ipa/ca.crt"
ipa_hostname: "%{facts.fqdn}"
ipa_hostname: "%{facts.networking.fqdn}"
chpass_provider: "ipa"
ipa_server:
- "_srv_"
Expand Down Expand Up @@ -472,9 +472,9 @@ mit_krb5::domain_realms:
domains:
- ".%{lookup('ipa::domain')}"
- "%{lookup('ipa::domain')}"
- "%{facts.fqdn}"
- ".%{facts.domain}"
- "%{facts.domain}"
- "%{facts.networking.fqdn}"
- ".%{facts.networking.domain}"
- "%{facts.networking.domain}"

openldap::client::tls_cacertdir: "/etc/openldap/certs"
openldap::client::sasl_nocanon: true
Expand All @@ -489,7 +489,7 @@ profile::core::ipa::default:
realm: "%{lookup('mit_krb5::default_realm')}"
domain: "%{lookup('ipa::domain')}"
server: "%{lookup('ipa::ipa_master_fqdn')}"
host: "%{facts.fqdn}"
host: "%{facts.networking.fqdn}"
xmlrpc_uri: "https://%{lookup('ipa::ipa_master_fqdn')}/ipa/xml"
enable_ra: "True"

Expand All @@ -501,7 +501,7 @@ resolv_conf::options:
# Use NFSv4 on NFS enabled hosts.
nfs::nfs_v4: true
nfs::nfs_v4_client: true
nfs::nfs_v4_idmap_domain: "%{::domain}"
nfs::nfs_v4_idmap_domain: "%{facts.networking.domain}"

profile::ccs::common::pkgurl: "https://repo-nexus.lsst.org/nexus/repository/ccs_private"
ccs_hcu::pkgurl: "%{lookup('profile::ccs::common::pkgurl')}"
Expand Down Expand Up @@ -562,7 +562,7 @@ profile::core::firewall::firewall:
proto: "all"
jump: "reject"

restic::bucket: "rubin-bm-backups/%{facts.fqdn}"
restic::bucket: "rubin-bm-backups/%{facts.networking.fqdn}"
restic::enable_backup: true
restic::host: "s3.us-east-1.amazonaws.com"

Expand All @@ -574,7 +574,7 @@ rke2::version: "1.28.12~rke2r1"
rke2::versionlock: true
rke2::config:
server: "https://%{::cluster}.%{::site}.lsst.org:9345"
node-name: "%{facts.hostname}"
node-name: "%{facts.networking.hostname}"
tls-san:
- "%{::cluster}.%{::site}.lsst.org"
disable:
Expand Down
4 changes: 2 additions & 2 deletions hieradata/node/auxtel-daq-mgt.cp.lsst.org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ nfs::nfs_v4_client: false # XXX disable v4 because of DAQ
nfs::client_mounts:
/net/self/dsl:
share: "/srv/nfs/dsl"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true
/net/self/lsst-daq:
share: "/srv/nfs/lsst-daq"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true
2 changes: 1 addition & 1 deletion hieradata/node/auxtel-fp01.cp.lsst.org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ nfs::client_enabled: true
nfs::client_mounts:
/net/self/data:
share: "data"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true

ccs_software::services:
Expand Down
2 changes: 1 addition & 1 deletion hieradata/node/auxtel-fp01.ls.lsst.org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ nfs::client_enabled: true
nfs::client_mounts:
/net/self/ccs-data:
share: "ccs-data"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true

ccs_software::services:
Expand Down
2 changes: 1 addition & 1 deletion hieradata/node/auxtel-fp01.tu.lsst.org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ nfs::client_enabled: true
nfs::client_mounts:
/net/self/ccs-data:
share: "ccs-data"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true

ccs_software::services:
Expand Down
6 changes: 3 additions & 3 deletions hieradata/node/comcam-archiver.cp.lsst.org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ network::interfaces_hash:
onboot: "no"
type: "Ethernet"

network::hostname: "%{facts.fqdn}"
network::hostname: "%{facts.networking.fqdn}"
network::mroutes_hash:
em2:
routes:
Expand Down Expand Up @@ -95,11 +95,11 @@ nfs::client_enabled: true
nfs::client_mounts:
/net/self/data/lsstdata:
share: "lsstdata"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true
/repo:
share: "repo"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true

profile::core::k5login::k5login:
Expand Down
4 changes: 2 additions & 2 deletions hieradata/node/comcam-archiver.tu.lsst.org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ nfs::client_enabled: true
nfs::client_mounts:
/net/self/data/lsstdata:
share: "lsstdata"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true
/repo:
share: "repo"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true

profile::core::k5login::k5login:
Expand Down
4 changes: 2 additions & 2 deletions hieradata/node/comcam-daq-mgt.cp.lsst.org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ nfs::nfs_v4_client: false # XXX disable v4 because of DAQ
nfs::client_mounts:
/net/self/dsl:
share: "/srv/nfs/dsl"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true
/net/self/lsst-daq:
share: "/srv/nfs/lsst-daq"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true
2 changes: 1 addition & 1 deletion hieradata/node/comcam-fp01.cp.lsst.org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ nfs::nfs_v4_client: true
nfs::client_mounts:
/net/self/ccs-data:
share: "/ccs-data"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true

hosts::entries:
Expand Down
2 changes: 1 addition & 1 deletion hieradata/node/comcam-fp01.tu.lsst.org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ nfs::client_enabled: true
nfs::client_mounts:
/net/self/ccs-data:
share: "ccs-data"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true

profile::ccs::file_transfer::s3daemon: true
Expand Down
4 changes: 2 additions & 2 deletions hieradata/node/daq-mgt.tu.lsst.org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ nfs::nfs_v4_client: false # XXX disable v4 because of DAQ
nfs::client_mounts:
/net/self/dsl:
share: "/srv/nfs/dsl"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true
/net/self/lsst-daq:
share: "/srv/nfs/lsst-daq"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true
4 changes: 2 additions & 2 deletions hieradata/node/lsstcam-daq-mgt.cp.lsst.org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ nfs::nfs_v4_client: false # XXX disable v4 because of DAQ
nfs::client_mounts:
/net/self/dsl:
share: "/srv/nfs/dsl"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true
/net/self/lsst-daq:
share: "/srv/nfs/lsst-daq"
server: "%{facts.fqdn}"
server: "%{facts.networking.fqdn}"
atboot: true
Loading
Loading