sunetdrive/functions/get_customer.pp

18 lines
485 B
ObjectPascal
Raw 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 {
2024-10-09 12:25:34 +00:00
$hostnameparts = split($facts['networking']['fqdn'],'\.')
2023-02-13 09:44:56 +00:00
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]
}