Skip to content

Commit

Permalink
Move to setup_acceptance_node.pp
Browse files Browse the repository at this point in the history
Rather than writing the setup code in Ruby, this is now written in
Puppet. That works better with modulesync. It also switches from the
legacy operatingsystem fact to the modern os.name fact. This is now
easily detectable with puppet-lint.
  • Loading branch information
ekohl committed Jan 6, 2024
1 parent 1b96532 commit c76fea6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
spec/spec_helper_acceptance.rb:
unmanaged: false
.puppet-lint.rc:
enabled_lint_checks:
- parameter_documentation
Expand Down
15 changes: 15 additions & 0 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
case $facts['os']['name'] {
'CentOS': {
# Mosquitto is packaged in EPEL
package { 'epel-release':
ensure => installed,
}
}
'Fedora': {
# For serverspec
package { 'iproute':
ensure => installed,
}
}
default: {}
}
15 changes: 6 additions & 9 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# frozen_string_literal: true

# This file is completely managed via modulesync
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

require 'voxpupuli/acceptance/spec_helper_acceptance'

configure_beaker do |host|
case fact_on(host, 'operatingsystem')
when 'CentOS'
host.install_package('epel-release')
when 'Fedora'
host.install_package('iproute')
end
end
configure_beaker(modules: :metadata)

Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f }

0 comments on commit c76fea6

Please sign in to comment.