From b4c889e778bec07f408b32c4e2cccd25b3d02adb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Str=C3=B6mb=C3=A4ck?= <filip.stromback@liu.se>
Date: Fri, 1 Sep 2023 09:39:06 +0200
Subject: [PATCH] Fixed issues notified by Thomas.

---
 manifests/auth.pp       | 5 +++--
 manifests/auth_keydb.pp | 4 ++--
 manifests/broker.pp     | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/manifests/auth.pp b/manifests/auth.pp
index 81111c8..0d746c4 100644
--- a/manifests/auth.pp
+++ b/manifests/auth.pp
@@ -29,16 +29,17 @@ class aes::auth (
   # Pick the right keytab for the current environment. We use the fqdn rather than 
   # $environment since the keys are tied to the domain name rather than what 
   # environment the machine is configured in.
-  if $facts[fqdn] == 'aes.edu.liu.se' {
+  if $facts[networking][fqdn] == 'aes.edu.liu.se' {
     # The AD service account for this key is: ida_sys002_srv
     $auth_keytab_data = $keytab_production
     $server_type = 'production'
-  } elsif $facts[fqdn] == 'aes-devel.edu.liu.se' {
+  } elsif $facts[networking][fqdn] == 'aes-devel.edu.liu.se' {
     # The AD service account for this key is: ida_sys004_srv
     $auth_keytab_data = $keytab_devel
     $server_type = 'devel'
   } else {
     $auth_keytab_data = undef
+    $server_type = 'devel'
   }
 
   # Note: We rely on Boost being installed by the broker. It seems Puppet does not like
diff --git a/manifests/auth_keydb.pp b/manifests/auth_keydb.pp
index 238a7b3..f71e86b 100644
--- a/manifests/auth_keydb.pp
+++ b/manifests/auth_keydb.pp
@@ -12,9 +12,9 @@ class aes::auth_keydb {
   $keydb_service = 'aes_auth_keydb'
 
   # Figure out which certificate to use based on the hostname.
-  if $facts[fqdn] == 'aes.edu.liu.se' {
+  if $facts[networking][fqdn] == 'aes.edu.liu.se' {
     $server_type = 'production'
-  } elsif $facts[fqdn] == 'aes-devel.edu.liu.se' {
+  } elsif $facts[networking][fqdn] == 'aes-devel.edu.liu.se' {
     $server_type = 'devel'
   } else {
     $server_type = undef
diff --git a/manifests/broker.pp b/manifests/broker.pp
index 0bdad4a..880145b 100644
--- a/manifests/broker.pp
+++ b/manifests/broker.pp
@@ -22,9 +22,9 @@ class aes::broker {
   }
 
   # Figure out which certificate to use based on the hostname.
-  if $facts[fqdn] == 'aes.edu.liu.se' {
+  if $facts[networking][fqdn] == 'aes.edu.liu.se' {
     $server_type = 'production'
-  } elsif $facts[fqdn] == 'aes-devel.edu.liu.se' {
+  } elsif $facts[networking][fqdn] == 'aes-devel.edu.liu.se' {
     $server_type = 'devel'
   } else {
     $server_type = undef
-- 
GitLab