2020-12-20 22:56:42 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-03-30 12:55:03 +02:00
|
|
|
pkgs =
|
|
|
|
case system.platform[:name]
|
|
|
|
when 'arch'
|
|
|
|
%w[salt]
|
|
|
|
when /bsd$/
|
2022-07-14 06:12:36 +02:00
|
|
|
%w[py39-salt]
|
2021-03-30 12:55:03 +02:00
|
|
|
when 'windows'
|
2021-09-04 22:25:43 +02:00
|
|
|
['Salt Minion']
|
2022-05-17 08:39:37 +02:00
|
|
|
when 'mac_os_x'
|
|
|
|
%w[salt saltstack]
|
2021-03-30 12:55:03 +02:00
|
|
|
else
|
|
|
|
%w[salt-master salt-minion]
|
|
|
|
end
|
|
|
|
|
2020-12-20 22:56:42 +01:00
|
|
|
control 'salt packages' do
|
|
|
|
title 'should be installed'
|
|
|
|
|
2021-03-30 12:55:03 +02:00
|
|
|
pkgs.each do |p|
|
2020-12-20 22:56:42 +01:00
|
|
|
describe package(p) do
|
|
|
|
it { should be_installed }
|
2021-11-17 22:53:19 +01:00
|
|
|
its('version') { should match(/^#{input('saltmajorversion')}/) }
|
2020-12-20 22:56:42 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|