From 5cea9f3434a925c4ad19c652a69586597802de82 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Sat, 6 Jan 2024 15:39:59 +0100 Subject: [PATCH] Move to setup_acceptance_node.pp 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. --- spec/setup_acceptance_node.pp | 15 +++++++++++++++ spec/spec_helper_acceptance.rb | 9 --------- 2 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 spec/setup_acceptance_node.pp diff --git a/spec/setup_acceptance_node.pp b/spec/setup_acceptance_node.pp new file mode 100644 index 0000000..7977589 --- /dev/null +++ b/spec/setup_acceptance_node.pp @@ -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: {} +} diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 83f2075..a97f642 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -2,12 +2,3 @@ # This file is completely managed via 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