Skip to content

Commit

Permalink
Fix serverspec
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-robertson committed May 31, 2024
1 parent 904fff1 commit 7b50fbf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
6 changes: 5 additions & 1 deletion spec/acceptance/observium_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

describe 'Installation', if: ['centos', 'redhat', 'ubuntu'].include?(os[:family]) do
before(:all) do
install_packge('crontabs')
if os[:family] == 'redhat'
install_packge('crontabs')
elsif os[:family] == 'ubuntu'
install_packge('cron')
end
end

let(:hiera_config) { 'hiera-rpsec.yaml' }
Expand Down
13 changes: 6 additions & 7 deletions spec/spec_helper_acceptance_local.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
include PuppetLitmus

def install_packge(package)
if os[:family] == 'ubuntu'
run_shell("apt -y install #{package}")
end
if os[:family] == 'redhat'
run_shell("yum -y install #{package}")
end

if os[:family] == 'redhat'
run_shell("yum -y install #{package}")
elsif os[:family] == 'ubuntu'
run_shell('apt update')
run_shell("apt -y install #{package}")
end
end

0 comments on commit 7b50fbf

Please sign in to comment.