You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pretty new to inspec so forgive me if I'm just missing something here, but I ran into an issue when writing specs with the service resource where I needed to specify service for my Ubuntu 14.04 box and sysv_service for my Centos 7.2 box (using with test kitchen).
My test:
if os[:family] == 'centos'
describe sysv_service('zabbix_agentd') do
it { should be_installed }
it { should be_running }
it { should be_running }
end
else
describe service('zabbix_agentd') do
it { should be_installed }
it { should be_enabled }
it { should be_running }
end
end
Note that I've had to compare against 'centos' here because that is the value being returned by os[:family] on my Centos box. However, in the docs the options that can be returned by os[:family] are:
bsd, debian, linux, redhat, solaris, suse, unix, or windows
os[:family] looks like it's meant to function like node['platform_family'] in a Chef recipe but seems to be functioning like node['platform'] for me.
InSpec and Platform Version
Inspec 0.28.0
Mac OSX 10.11.5
Replication Case
With centos-7.2 as a platform, $ kitchen create default-centos-72
Add puts os[:family] in any spec file
$ kitchen verify default-centos-72 will print what is being returned as the family
The text was updated successfully, but these errors were encountered:
Hi all,
Pretty new to inspec so forgive me if I'm just missing something here, but I ran into an issue when writing specs with the
service
resource where I needed to specifyservice
for my Ubuntu 14.04 box andsysv_service
for my Centos 7.2 box (using with test kitchen).My test:
Note that I've had to compare against
'centos'
here because that is the value being returned byos[:family]
on my Centos box. However, in the docs the options that can be returned byos[:family]
are:os[:family]
looks like it's meant to function likenode['platform_family']
in a Chef recipe but seems to be functioning likenode['platform']
for me.InSpec and Platform Version
Inspec 0.28.0
Mac OSX 10.11.5
Replication Case
centos-7.2
as a platform,$ kitchen create default-centos-72
puts os[:family]
in any spec file$ kitchen verify default-centos-72
will print what is being returned as the familyThe text was updated successfully, but these errors were encountered: