Merge "Switch os_package_type to use os fact"

This commit is contained in:
Zuul 2020-04-03 19:18:38 +00:00 committed by Gerrit Code Review
commit 814f57af27
1 changed files with 5 additions and 4 deletions

View File

@ -12,17 +12,18 @@
#
# In all other cases, we can consider that we're using vanilia (ie: unmodified)
# distribution packages, and we can set $::os_package_type depending on the
# value of $::operatingsystem.
# value of $::os['name']
#
# Having the below snipets helps simplifying checks within individual project
# manifests, so that we can just reuse $::os_package_type directly without
# having to also check if it contains a value, then check for the content of
# $::operatingsystem (ie: what's below factors the check once and for all).
# $::os['family'] (ie: what's below factors the check once and for all).
Facter.add('os_package_type') do
setcode do
case Facter.value(:osfamily)
os = Facter.value(:os)
case os['family']
when 'Debian'
if Facter.value(:operatingsystem) == 'Debian' then
if os['name'] == 'Debian' then
'debian'
else
'ubuntu'