test(platform_finger): extract from shared library

This commit is contained in:
Imran Iqbal 2020-09-04 21:19:33 +01:00
parent fc90075dd9
commit d68ed45109
No known key found for this signature in database
GPG key ID: 6D8629439D2B7819
3 changed files with 5 additions and 5 deletions

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Prepare platform "finger"
platform_finger = "#{platform[:name]}-#{platform[:release].split('.')[0]}"
platform_finger = system.platform[:finger].split('.').first.to_s
control 'TEMPLATE package' do
title 'should be installed'
@ -9,7 +9,7 @@ control 'TEMPLATE package' do
# Overide by `platform_finger`
package_name =
case platform_finger
when 'centos-6', 'amazon-2018'
when 'centos-6', 'amazonlinux-1'
'cronie'
else
'bash'

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Prepare platform "finger"
platform_finger = "#{platform[:name]}-#{platform[:release].split('.')[0]}"
platform_finger = system.platform[:finger].split('.').first.to_s
control 'TEMPLATE service' do
impact 0.5
@ -10,7 +10,7 @@ control 'TEMPLATE service' do
# Overide by `platform_finger`
service_name =
case platform_finger
when 'centos-6', 'amazon-2018'
when 'centos-6', 'amazonlinux-1'
'crond'
else
'systemd-journald'

View file

@ -10,7 +10,7 @@ Its goal is to share the libraries between all profiles.
The `system` library provides easy access to system dependent information:
- `system.hostname`: return the result of `hostname -s` or `hostnamectl --static` based on the availability of either commands
- `system.hostname`: return the result of `hostname -s` or `hostnamectl --static` based on the availability of either command
- `system.platform`: based on `inspec.platform`, modify to values that are more consistent from a SaltStack perspective
- `system.platform[:family]` provide a family name for Arch
- `system.platform[:name]` modify `amazon` to `amazonlinux`