sunetdrive/functions/get_customer.pp

18 lines
471 B
ObjectPascal
Raw Permalink Normal View History

2023-02-13 09:44:56 +00:00
# Lets determin who the customer is by looking at the hostname
function sunetdrive::get_customer() >> String {
$hostnameparts = split($facts['fqdn'],'\.')
if $hostnameparts[1] == 'drive' {
if $hostnameparts[0] =~ /^gss/ {
return 'gss'
} elsif $hostnameparts[0] =~ /^lookup/ {
return 'lookup'
} else {
return 'common'
}
} elsif $hostnameparts[0] =~ /idp-proxy/ {
return 'common'
}
return $hostnameparts[1]
}