sunetdrive/functions/get_environment.pp

14 lines
328 B
ObjectPascal
Raw Normal View History

2023-02-13 10:44:56 +01:00
# Lets determin where we are by looking at the hostname
function sunetdrive::get_environment() >> String {
2024-10-09 14:25:34 +02:00
$hostname = $facts['networking']['fqdn']
2023-02-13 10:44:56 +01:00
if $hostname =~ /^.*\.drive\.sunet\.se$/ {
if $hostname =~ /^.*\.pilot\.drive\.sunet\.se$/ {
return 'pilot'
}
else {
return 'prod'
}
}
'test'
}